!(function(t, e) {
	'object' == typeof exports && 'object' == typeof module
		? (module.exports = e(
				require('trtc-js-sdk'),
				require('tim-js-sdk'),
				require('tsignaling')
		  ))
		: 'function' == typeof define && define.amd
		? define(['trtc-js-sdk', 'tim-js-sdk', 'tsignaling'], e)
		: 'object' == typeof exports
		? (exports.TRTCCalling = e(
				require('trtc-js-sdk'),
				require('tim-js-sdk'),
				require('tsignaling')
		  ))
		: (t.TRTCCalling = e(t.TRTC, t.TIM, t.TSignaling));
})(window, function(t, e, n) {
	return (function(t) {
		var e = {};
		function n(i) {
			if (e[i]) return e[i].exports;
			var r = (e[i] = { i: i, l: !1, exports: {} });
			return t[i].call(r.exports, r, r.exports, n), (r.l = !0), r.exports;
		}
		return (
			(n.m = t),
			(n.c = e),
			(n.d = function(t, e, i) {
				n.o(t, e) ||
					Object.defineProperty(t, e, { enumerable: !0, get: i });
			}),
			(n.r = function(t) {
				'undefined' != typeof Symbol &&
					Symbol.toStringTag &&
					Object.defineProperty(t, Symbol.toStringTag, {
						value: 'Module',
					}),
					Object.defineProperty(t, '__esModule', { value: !0 });
			}),
			(n.t = function(t, e) {
				if ((1 & e && (t = n(t)), 8 & e)) return t;
				if (4 & e && 'object' == typeof t && t && t.__esModule)
					return t;
				var i = Object.create(null);
				if (
					(n.r(i),
					Object.defineProperty(i, 'default', {
						enumerable: !0,
						value: t,
					}),
					2 & e && 'string' != typeof t)
				)
					for (var r in t)
						n.d(
							i,
							r,
							function(e) {
								return t[e];
							}.bind(null, r)
						);
				return i;
			}),
			(n.n = function(t) {
				var e =
					t && t.__esModule
						? function() {
								return t.default;
						  }
						: function() {
								return t;
						  };
				return n.d(e, 'a', e), e;
			}),
			(n.o = function(t, e) {
				return Object.prototype.hasOwnProperty.call(t, e);
			}),
			(n.p = ''),
			n((n.s = 23))
		);
	})([
		function(t, e, n) {
			'use strict';
			n.r(e),
				n.d(e, 'isMap', function() {
					return r;
				}),
				n.d(e, 'isSet', function() {
					return o;
				}),
				n.d(e, 'isFile', function() {
					return s;
				}),
				n.d(e, 'isNumber', function() {
					return a;
				}),
				n.d(e, 'isString', function() {
					return l;
				}),
				n.d(e, 'isObject', function() {
					return u;
				}),
				n.d(e, 'isPlainObject', function() {
					return c;
				}),
				n.d(e, 'isArray', function() {
					return d;
				}),
				n.d(e, 'isUndefined', function() {
					return f;
				}),
				n.d(e, 'isNativeClass', function() {
					return p;
				}),
				n.d(e, 'isArrayOrObject', function() {
					return _;
				}),
				n.d(e, 'isFunction', function() {
					return g;
				}),
				n.d(e, 'isInstanceOfError', function() {
					return I;
				}),
				n.d(e, 'getType', function() {
					return m;
				}),
				n.d(e, 'TimeUtil', function() {
					return v;
				}),
				n.d(e, 'stringifyError', function() {
					return E;
				}),
				n.d(e, 'map2String', function() {
					return T;
				}),
				n.d(e, 'randomString', function() {
					return L;
				}),
				n.d(e, 'isValidType', function() {
					return D;
				}),
				n.d(e, 'mapKeys', function() {
					return A;
				}),
				n.d(e, 'mapValues', function() {
					return b;
				}),
				n.d(e, 'generateRandomRoomID', function() {
					return O;
				}),
				n.d(e, 'formatDuration', function() {
					return w;
				}),
				n.d(e, 'compareVersion', function() {
					return U;
				}),
				n.d(e, 'date2ISOString', function() {
					return R;
				}),
				n.d(e, 'getHostType', function() {
					return V;
				});
			var i = n(5);
			const r = function(t) {
					return 'map' === m(t);
				},
				o = function(t) {
					return 'set' === m(t);
				},
				s = function(t) {
					return 'file' === m(t);
				},
				a = function(t) {
					return (
						null !== t &&
						(('number' == typeof t && !isNaN(t - 0)) ||
							('object' == typeof t && t.constructor === Number))
					);
				},
				l = function(t) {
					return 'string' == typeof t;
				},
				u = function(t) {
					return null !== t && 'object' == typeof t;
				},
				c = function(t) {
					if ('object' != typeof t || null === t) return !1;
					const e = Object.getPrototypeOf(t);
					if (null === e) return !0;
					let n = e;
					for (; null !== Object.getPrototypeOf(n); )
						n = Object.getPrototypeOf(n);
					return e === n;
				},
				d = function(t) {
					return 'function' == typeof Array.isArray
						? Array.isArray(t)
						: 'array' === m(t);
				},
				f = function(t) {
					return void 0 === t;
				},
				h = /^class\s/,
				p = function(t) {
					return 'function' == typeof t && h.test(t.toString());
				},
				_ = function(t) {
					return d(t) || u(t);
				},
				g = function(t) {
					return 'function' == typeof t;
				},
				I = function(t) {
					return t instanceof Error;
				},
				m = function(t) {
					return Object.prototype.toString
						.call(t)
						.match(/^\[object (.*)\]$/)[1]
						.toLowerCase();
				};
			let C = 0;
			Date.now ||
				(Date.now = function() {
					return new Date().getTime();
				});
			const v = {
					now() {
						0 === C && (C = Date.now() - 1);
						const t = Date.now() - C;
						return t > 4294967295
							? ((C += 4294967295), Date.now() - C)
							: t;
					},
					utc: () => Math.round(Date.now() / 1e3),
				},
				E = function(t) {
					return JSON.stringify(t, ['message', 'code']);
				},
				T = function(t) {
					if (!r(t)) return 'not a map!!!';
					let e = '';
					for (const [n, i] of t.entries()) {
						if (r(i)) return `[k=${n} -> ${T(i)}`;
						e += `[k=${n} v=${i}] `;
					}
					return e;
				},
				y =
					'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
				S = y.length,
				L = function() {
					let t = '';
					for (let e = 32; e > 0; --e)
						t += y[Math.floor(Math.random() * S)];
					return t;
				},
				D = function(t, e) {
					for (const n in t) if (t[n] === e) return !0;
					return !1;
				};
			function A(t, e) {
				const n = {};
				return (
					Object.keys(t).forEach((i) => {
						n[e(t[i], i)] = t[i];
					}),
					n
				);
			}
			function b(t, e) {
				const n = {};
				return (
					Object.keys(t).forEach((i) => {
						n[i] = e(t[i], i);
					}),
					n
				);
			}
			function O() {
				return Math.round(1e8 * Math.random());
			}
			function N(t) {
				return t < 10 ? '0' + t : t;
			}
			function w(t) {
				if (t < 60) return '00:00:' + N(t);
				if (t < 3600) {
					const e = parseInt(t / 60),
						n = t - 60 * e;
					return `00:${N(e)}:${N(n)}`;
				}
				const e = parseInt(t / 3600),
					n = t - 3600 * e,
					i = parseInt(n / 60),
					r = n - 60 * i;
				return `${N(e)}:${N(i)}:${N(r)}`;
			}
			function U(t, e) {
				(t = t.split('.')), (e = e.split('.'));
				const n = Math.max(t.length, e.length);
				for (; t.length < n; ) t.push('0');
				for (; e.length < n; ) e.push('0');
				for (let i = 0; i < n; i++) {
					const n = parseInt(t[i]),
						r = parseInt(e[i]);
					if (n > r) return 1;
					if (n < r) return -1;
				}
				return 0;
			}
			const R = function() {
				const t = new Date(),
					e = t.toISOString(),
					n = t.getTimezoneOffset() / 60;
				let i = '';
				return (
					(i =
						n < 0
							? n > -10
								? '+0' + Math.abs(100 * n)
								: '+' + Math.abs(100 * n)
							: n >= 10
							? '-' + 100 * n
							: '-0' + 100 * n),
					e.replace('Z', i)
				);
			};
			function V() {
				let t = 'unknown';
				return (
					i.IS_MAC && (t = 'mac'),
					i.IS_WIN && (t = 'windows'),
					i.IS_IOS && (t = 'ios'),
					i.IS_ANDROID && (t = 'android'),
					t
				);
			}
		},
		function(t, e, n) {
			'use strict';
			n.r(e);
			var i = n(3),
				r = n(0);
			let o = 0;
			const s = new Map();
			function a() {
				const t = new Date();
				return `TRTCCalling ${t.toLocaleTimeString('en-US', {
					hour12: !1,
				})}.${(function(t) {
					let e;
					switch (t.toString().length) {
						case 1:
							e = '00' + t;
							break;
						case 2:
							e = '0' + t;
							break;
						default:
							e = t;
					}
					return e;
				})(t.getMilliseconds())}:`;
			}
			const l = {
				_data: [],
				_length: 0,
				_visible: !1,
				arguments2String(t) {
					let e;
					if (1 === t.length) e = a() + t[0];
					else {
						e = a();
						for (let n = 0, { length: i } = t; n < i; n++)
							Object(r.isArrayOrObject)(t[n])
								? Object(r.isInstanceOfError)(t[n])
									? (e += Object(r.stringifyError)(t[n]))
									: (e += JSON.stringify(t[n]))
								: (e += t[n]),
								(e += ' ');
					}
					return e;
				},
				debug() {
					if (o <= -1) {
						const t = this.arguments2String(arguments);
						l.record(t, 'debug'), i.a.debug(t);
					}
				},
				log() {
					if (o <= 0) {
						const t = this.arguments2String(arguments);
						l.record(t, 'log'), i.a.log(t);
					}
				},
				info() {
					if (o <= 1) {
						const t = this.arguments2String(arguments);
						l.record(t, 'info'), i.a.info(t);
					}
				},
				warn() {
					if (o <= 2) {
						const t = this.arguments2String(arguments);
						l.record(t, 'warn'), i.a.warn(t);
					}
				},
				error() {
					if (o <= 3) {
						const t = this.arguments2String(arguments);
						l.record(t, 'error'), i.a.error(t);
					}
				},
				time(t) {
					s.set(t, r.TimeUtil.now());
				},
				timeEnd(t) {
					if (s.has(t)) {
						const e = r.TimeUtil.now() - s.get(t);
						return s.delete(t), e;
					}
					return (
						i.a.warn(
							`未找到对应label: ${t}, 请在调用 logger.timeEnd 前，调用 logger.time`
						),
						0
					);
				},
				setLevel(t) {
					t < 4 && i.a.log(`${a()}set level from ${o} to ${t}`),
						(o = t);
				},
				getLevel: () => o,
				record(t, e) {
					1100 === l._length &&
						(l._data.splice(0, 100), (l._length = 1e3)),
						l._length++,
						l._data.push(`${t} [${e}] \n`);
				},
				getLog: () => l._data,
			};
			e.default = l;
		},
		function(t, e, n) {
			'use strict';
			var i = n(12),
				r = Object.prototype.toString;
			function o(t) {
				return '[object Array]' === r.call(t);
			}
			function s(t) {
				return void 0 === t;
			}
			function a(t) {
				return null !== t && 'object' == typeof t;
			}
			function l(t) {
				if ('[object Object]' !== r.call(t)) return !1;
				var e = Object.getPrototypeOf(t);
				return null === e || e === Object.prototype;
			}
			function u(t) {
				return '[object Function]' === r.call(t);
			}
			function c(t, e) {
				if (null != t)
					if (('object' != typeof t && (t = [t]), o(t)))
						for (var n = 0, i = t.length; n < i; n++)
							e.call(null, t[n], n, t);
					else
						for (var r in t)
							Object.prototype.hasOwnProperty.call(t, r) &&
								e.call(null, t[r], r, t);
			}
			t.exports = {
				isArray: o,
				isArrayBuffer: function(t) {
					return '[object ArrayBuffer]' === r.call(t);
				},
				isBuffer: function(t) {
					return (
						null !== t &&
						!s(t) &&
						null !== t.constructor &&
						!s(t.constructor) &&
						'function' == typeof t.constructor.isBuffer &&
						t.constructor.isBuffer(t)
					);
				},
				isFormData: function(t) {
					return (
						'undefined' != typeof FormData && t instanceof FormData
					);
				},
				isArrayBufferView: function(t) {
					return 'undefined' != typeof ArrayBuffer &&
						ArrayBuffer.isView
						? ArrayBuffer.isView(t)
						: t && t.buffer && t.buffer instanceof ArrayBuffer;
				},
				isString: function(t) {
					return 'string' == typeof t;
				},
				isNumber: function(t) {
					return 'number' == typeof t;
				},
				isObject: a,
				isPlainObject: l,
				isUndefined: s,
				isDate: function(t) {
					return '[object Date]' === r.call(t);
				},
				isFile: function(t) {
					return '[object File]' === r.call(t);
				},
				isBlob: function(t) {
					return '[object Blob]' === r.call(t);
				},
				isFunction: u,
				isStream: function(t) {
					return a(t) && u(t.pipe);
				},
				isURLSearchParams: function(t) {
					return (
						'undefined' != typeof URLSearchParams &&
						t instanceof URLSearchParams
					);
				},
				isStandardBrowserEnv: function() {
					return (
						('undefined' == typeof navigator ||
							('ReactNative' !== navigator.product &&
								'NativeScript' !== navigator.product &&
								'NS' !== navigator.product)) &&
						'undefined' != typeof window &&
						'undefined' != typeof document
					);
				},
				forEach: c,
				merge: function t() {
					var e = {};
					function n(n, i) {
						l(e[i]) && l(n)
							? (e[i] = t(e[i], n))
							: l(n)
							? (e[i] = t({}, n))
							: o(n)
							? (e[i] = n.slice())
							: (e[i] = n);
					}
					for (var i = 0, r = arguments.length; i < r; i++)
						c(arguments[i], n);
					return e;
				},
				extend: function(t, e, n) {
					return (
						c(e, function(e, r) {
							t[r] = n && 'function' == typeof e ? i(e, n) : e;
						}),
						t
					);
				},
				trim: function(t) {
					return t.replace(/^\s*/, '').replace(/\s*$/, '');
				},
				stripBOM: function(t) {
					return 65279 === t.charCodeAt(0) && (t = t.slice(1)), t;
				},
			};
		},
		function(t, e, n) {
			'use strict';
			(function(t) {
				let n, i;
				n =
					'undefined' != typeof console
						? console
						: void 0 !== t && t.console
						? t.console
						: 'undefined' != typeof window && window.console
						? window.console
						: {};
				const r = function() {},
					o = [
						'assert',
						'clear',
						'count',
						'debug',
						'dir',
						'dirxml',
						'error',
						'exception',
						'group',
						'groupCollapsed',
						'groupEnd',
						'info',
						'log',
						'markTimeline',
						'profile',
						'profileEnd',
						'table',
						'time',
						'timeEnd',
						'timeStamp',
						'trace',
						'warn',
					];
				let { length: s } = o;
				for (; s--; ) (i = o[s]), console[i] || (n[i] = r);
				(n.methods = o), (e.a = n);
			}.call(this, n(26)));
		},
		function(t, e, n) {
			'use strict';
			Object.defineProperty(e, '__esModule', { value: !0 });
			e.default = {
				UNKNOWN: 65535,
				NO_SDK_APPID: 2e3,
				NO_ACCOUNT_TYPE: 2001,
				NO_IDENTIFIER: 2002,
				NO_USER_SIG: 2003,
				NO_TINY_ID: 2022,
				NO_A2KEY: 2023,
				USER_NOT_LOGGED_IN: 2024,
				NO_NETWORK: 2805,
				FAILURE_SWITCH_TO_AUDIO: 60001,
				FAILURE_SWITCH_TO_VIDEO: 60002,
				NOT_MICROPHONE_LIST: 60003,
				NOT_CAMERA_LIST: 60004,
				NOT_MEDIA_ACCESS: 60005,
			};
		},
		function(t, e, n) {
			'use strict';
			n.r(e),
				n.d(e, 'IN_Browser', function() {
					return i;
				}),
				n.d(e, 'IN_WXMiniProgram', function() {
					return r;
				}),
				n.d(e, 'USER_AGENT', function() {
					return o;
				}),
				n.d(e, 'IS_IPAD', function() {
					return l;
				}),
				n.d(e, 'IS_IPHONE', function() {
					return u;
				}),
				n.d(e, 'IS_IPOD', function() {
					return c;
				}),
				n.d(e, 'IS_IOS', function() {
					return d;
				}),
				n.d(e, 'IOS_VERSION', function() {
					return f;
				}),
				n.d(e, 'IS_ANDROID', function() {
					return h;
				}),
				n.d(e, 'ANDROID_VERSION', function() {
					return p;
				}),
				n.d(e, 'IS_OLD_ANDROID', function() {
					return _;
				}),
				n.d(e, 'IS_NATIVE_ANDROID', function() {
					return g;
				}),
				n.d(e, 'IS_FIREFOX', function() {
					return I;
				}),
				n.d(e, 'FIREFOX_VERSION', function() {
					return m;
				}),
				n.d(e, 'IS_EDGE', function() {
					return C;
				}),
				n.d(e, 'IS_EDG', function() {
					return v;
				}),
				n.d(e, 'EDG_VERSION', function() {
					return E;
				}),
				n.d(e, 'IS_CHROME', function() {
					return T;
				}),
				n.d(e, 'CHROME_MAJOR_VERSION', function() {
					return y;
				}),
				n.d(e, 'CHROME_VERSION', function() {
					return S;
				}),
				n.d(e, 'IS_IE8', function() {
					return L;
				}),
				n.d(e, 'IE_VERSION', function() {
					return D;
				}),
				n.d(e, 'IS_SAFARI', function() {
					return A;
				}),
				n.d(e, 'IS_ANY_SAFARI', function() {
					return b;
				}),
				n.d(e, 'SAFARI_VERSION', function() {
					return O;
				}),
				n.d(e, 'IS_TBS', function() {
					return N;
				}),
				n.d(e, 'TBS_VERSION', function() {
					return w;
				}),
				n.d(e, 'IS_MQQB', function() {
					return U;
				}),
				n.d(e, 'IS_QQB', function() {
					return R;
				}),
				n.d(e, 'IS_WECHAT', function() {
					return V;
				}),
				n.d(e, 'IS_WIN', function() {
					return M;
				}),
				n.d(e, 'IS_MAC', function() {
					return x;
				}),
				n.d(e, 'IS_LINUX', function() {
					return j;
				}),
				n.d(e, 'IS_WX', function() {
					return P;
				}),
				n.d(e, 'IS_UCBROWSER', function() {
					return k;
				}),
				n.d(e, 'IS_MIUIBROWSER', function() {
					return G;
				}),
				n.d(e, 'IS_HUAWEIBROWSER', function() {
					return B;
				}),
				n.d(e, 'BROWSER_VERSION', function() {
					return H;
				}),
				n.d(e, 'IS_LOCAL', function() {
					return Y;
				});
			const i = 'undefined' != typeof window,
				r = 'undefined' != typeof wx,
				o = (window.navigator && window.navigator.userAgent) || '',
				s = /AppleWebKit\/([\d.]+)/i.exec(o),
				a = s ? parseFloat(s.pop()) : null,
				l = /iPad/i.test(o),
				u = /iPhone/i.test(o) && !l,
				c = /iPod/i.test(o),
				d = u || l || c,
				f = (function() {
					const t = o.match(/OS (\d+)_/i);
					return t && t[1] ? t[1] : null;
				})(),
				h = /Android/i.test(o),
				p = (function() {
					const t = o.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
					if (!t) return null;
					const e = t[1] && parseFloat(t[1]),
						n = t[2] && parseFloat(t[2]);
					return e && n ? parseFloat(`${t[1]}.${t[2]}`) : e || null;
				})(),
				_ = h && /webkit/i.test(o) && p < 2.3,
				g = h && p < 5 && a < 537,
				I = /Firefox/i.test(o),
				m = (function() {
					const t = o.match(/Firefox\/(\d+)/);
					return t && t[1] ? parseFloat(t[1]) : null;
				})(),
				C = /Edge\//i.test(o),
				v = /Edg\//i.test(o),
				E = (function() {
					const t = o.match(/Edg\/(\d+)/);
					return t && t[1] ? parseFloat(t[1]) : null;
				})(),
				T = !C && /Chrome/i.test(o),
				y = (function() {
					const t = o.match(/Chrome\/(\d+)/);
					return t && t[1] ? parseFloat(t[1]) : null;
				})(),
				S = (function() {
					const t = o.match(/Chrome\/([\d.]+)/);
					return t && t[1] ? t[1] : null;
				})(),
				L = /MSIE\s8\.0/.test(o),
				D = (function() {
					const t = /MSIE\s(\d+)\.\d/.exec(o);
					let e = t && parseFloat(t[1]);
					return (
						!e &&
							/Trident\/7.0/i.test(o) &&
							/rv:11.0/.test(o) &&
							(e = 11),
						e
					);
				})(),
				A = /Safari/i.test(o) && !T && !h && !C,
				b = A || d,
				O = (function() {
					const t = o.match(/Version\/([\d.]+)/);
					return t && t[1] ? t[1] : null;
				})(),
				N = /TBS\/\d+/i.test(o),
				w = (function() {
					const t = o.match(/TBS\/(\d+)/i);
					if (t && t[1]) return t[1];
				})(),
				U = !N && /MQQBrowser\/\d+/i.test(o),
				R = !N && / QQBrowser\/\d+/i.test(o),
				V = /(micromessenger|webbrowser)/i.test(o),
				M = /Windows/i.test(o),
				x = /MAC OS X/i.test(o),
				j = /Linux/i.test(o),
				P = /MicroMessenger/i.test(o),
				k = /UCBrowser/i.test(o),
				G = /MiuiBrowser/i.test(o),
				B = /HuaweiBrowser/i.test(o),
				H = T
					? 'Chrome/' + S
					: A
					? 'Safari/' + O
					: 'NotSupportedBrowser',
				Y =
					'file:' === location.protocol ||
					'localhost' === location.hostname ||
					/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname);
		},
		function(t, e, n) {
			'use strict';
			n.r(e);
			var i = n(0),
				r = n(1),
				o = n(4),
				s = n.n(o),
				a = n(21),
				l = n.n(a);
			class u {
				constructor(t) {
					(this.sdkappid = ''),
						(this.version = ''),
						(this.userid = ''),
						(this.platform = ''),
						(this.useragent = ''),
						(this.method = t),
						(this.codeint = 1),
						(this.calltype = 1),
						(this.talktime = 0),
						(this.message = ''),
						(this.text = ''),
						(this.startts = Date.now()),
						(this.endts = 0),
						(this.timespan = 0),
						(this.time = ''),
						(this.networktype = ''),
						(this.host = Object(i.getHostType)());
				}
				static bindController(t) {
					u.prototype._eventStatController = t;
				}
				setCommonInfo(t) {
					const {
						SDKAppID: e,
						version: n,
						userID: r,
						platform: o,
						scene: s,
					} = t;
					(this.sdkappid = e),
						(this.version = '' + n),
						(this.userid = r),
						(this.platform = o),
						(this.scene = s),
						(this.time = Object(i.date2ISOString)()),
						this.startts &&
							this.endts &&
							!this.timespan &&
							(this.timespan = Math.abs(
								this.endts - this.startts
							));
				}
				setEnd(t = !1) {
					(this.endts = Date.now()),
						t
							? this._eventStatController.pushIn(this)
							: setTimeout(() => {
									this._eventStatController.pushIn(this);
							  }, 0);
				}
				setError(t, e, n) {
					return (
						this.setNetworkType(n),
						e
							? (t.code && this.setCode(t.code),
							  t.message && this.setMessage(t.message))
							: (this.setCode(s.a.NO_NETWORK),
							  this.setMessage(l.a.NO_NETWORK)),
						this
					);
				}
				setCode(t) {
					return (
						'ECONNABORTED' === t && (this.codeint = 103),
						Object(i.isNumber)(t)
							? (this.codeint = t)
							: r.default.warn(
									'SSOLogData.setCode value not a number, please check!',
									t,
									typeof t
							  ),
						this
					);
				}
				setMessage(t) {
					return Object(i.isString)(t)
						? ((this.message = t), this)
						: this;
				}
				setText(t) {
					return (
						Object(i.isNumber)(t)
							? (this.text = t.toString())
							: Object(i.isString)(t) && (this.text = t),
						this
					);
				}
				setTalkTime(t) {
					return (this.talktime = t), this;
				}
				setMessageType(t) {
					return (this.msgType = t), this;
				}
				setCallType(t) {
					return (this.calltype = t), this;
				}
				setNetworkType(t) {
					return (
						Object(i.isUndefined)(t)
							? r.default.warn(
									'SSOLogData.setNetworkType value is undefined, please check!'
							  )
							: (this.networktype = t),
						this
					);
				}
			}
			e.default = u;
		},
		function(t, e, n) {
			'use strict';
			Object.defineProperty(e, '__esModule', { value: !0 }),
				(e.MODE_TYPE = e.VALID_VIDEO_PROFILE_LIST = e.BUSINESS_ID = e.ACTION_TYPE = e.CALL_STATUS = e.CMD_TYPE_LIST = e.CALL_TYPE = void 0),
				(function(t) {
					(t[(t.UNKNOWN = 0)] = 'UNKNOWN'),
						(t[(t.AUDIO_CALL = 1)] = 'AUDIO_CALL'),
						(t[(t.VIDEO_CALL = 2)] = 'VIDEO_CALL');
				})(e.CALL_TYPE || (e.CALL_TYPE = {})),
				(e.CMD_TYPE_LIST = ['', 'audioCall', 'videoCall']),
				(function(t) {
					(t.IDLE = 'idle'),
						(t.CALLING = 'calling'),
						(t.CONNECTED = 'connected');
				})(e.CALL_STATUS || (e.CALL_STATUS = {})),
				(function(t) {
					(t[(t.INVITE = 1)] = 'INVITE'),
						(t[(t.CANCEL_INVITE = 2)] = 'CANCEL_INVITE'),
						(t[(t.ACCEPT_INVITE = 3)] = 'ACCEPT_INVITE'),
						(t[(t.REJECT_INVITE = 4)] = 'REJECT_INVITE'),
						(t[(t.INVITE_TIMEOUT = 5)] = 'INVITE_TIMEOUT');
				})(e.ACTION_TYPE || (e.ACTION_TYPE = {})),
				(function(t) {
					t[(t.SIGNAL = 1)] = 'SIGNAL';
				})(e.BUSINESS_ID || (e.BUSINESS_ID = {})),
				(e.VALID_VIDEO_PROFILE_LIST = ['480p', '720p', '1080p']),
				(function(t) {
					(t.AUDIO = 'audio'), (t.VIDEO = 'video');
				})(e.MODE_TYPE || (e.MODE_TYPE = {}));
		},
		function(t, e, n) {
			'use strict';
			n.r(e);
			e.default = {
				SDK_CONSTRUCT: 'sdkConstruct',
				SDK_READY: 'sdkReady',
				SDK_NOT_READY: 'sdkNotReady',
				LOGIN: 'login',
				LOGOUT: 'logout',
				CALL: 'call',
				GROUP_CALL: 'groupCall',
				ACCEPT: 'accept',
				REJECT: 'reject',
				HANGUP: 'hangup',
				START_REMOTE_VIEW: 'startRemoteView',
				STOP_REMOTE_VIEW: 'stopRemoteView',
				START_LOCAL_VIEW: 'startLocalView',
				STOP_LOCAL_VIEW: 'stopLocalView',
				OPEN_CAMERA: 'openCamera',
				CLOSE_CAMERA: 'closeCamera',
				SET_MIC_MUTE: 'setMicMute',
				SET_VIDEO_QUALITY: 'setVideoQuality',
				SWITCH_TO_AUDIO_CALL: 'switchToAudioCall',
				SWITCH_TO_VIDEO_CALL: 'switchToVideoCall',
				KICKED_OUT: 'kickedOut',
				CHANGE_CALL_STATUS: 'changeCallStatus',
				TALK_TIME: 'talktime',
				ERROR: 'error',
				INVITED: 'invited',
				GROUP_CALL_INVITEE_LIST_UPDATE:
					'group_call_invitee_list_update',
				USER_ENTER: 'user_enter',
				USER_LEAVE: 'user_leave',
				REJECT: 'reject',
				NO_RESP: 'no_resp',
				LINE_BUSY: 'line_busy',
				CALLING_CANCEL: 'calling_cancel',
				KICKED_OUT: 'kicked_out',
				CALLING_TIMEOUT: 'calling_timeout',
				CALLING_END: 'calling_end',
				USER_VIDEO_AVAILABLE: 'user_video_available',
				USER_AUDIO_AVAILABLE: 'user_audio_available',
				USER_VOICE_VOLUME: 'user_voice_volume',
				GROUP_CALL_INVITEE_LIST_UPDATE:
					'group_call_invitee_list_update',
			};
		},
		function(t, e, n) {
			'use strict';
			n.r(e),
				n.d(e, 'default', function() {
					return p;
				});
			var i = n(1),
				r = n(0);
			class o {
				constructor() {
					(this._table = 'timweb-trtccalling'), (this._report = []);
				}
				pushIn(t) {
					i.default.debug(
						'SSOLogBody.pushIn',
						this._report.length,
						t
					),
						this._report.push(t);
				}
				backfill(t) {
					Object(r.isArray)(t) &&
						0 !== t.length &&
						(i.default.debug(
							'SSOLogBody.backfill',
							this._report.length,
							t.length
						),
						this._report.unshift(...t));
				}
				getLogsNumInMemory() {
					return this._report.length;
				}
				isEmpty() {
					return 0 === this._report.length;
				}
				_reset() {
					(this._report.length = 0), (this._report = []);
				}
				getTable() {
					return this._table;
				}
				getLogsInMemory() {
					const t = this._report.slice();
					return this._reset(), t;
				}
			}
			var s = n(6),
				a = n(10),
				l = n(22),
				u = n.n(l);
			const c = {
					CURRENT: { COMMON: 'https://webim.tim.qq.com' },
					PRODUCTION: { COMMON: 'https://webim.tim.qq.com' },
					OVERSEA_PRODUCTION: { COMMON: 'https://api.im.qcloud.com' },
					SANDBOX: { COMMON: 'https://events.tim.qq.com' },
					TEST: { COMMON: 'https://test.tim.qq.com' },
				},
				d = { IM_OPEN_STAT: 'imopenstat' },
				f = { TIM_WEB_TRTCCALLING_REPORT: 'tweb_trtccalling_report' },
				h = { imopenstat: 'v4' };
			class p {
				constructor() {
					(this.TAG = 'trtccalling-ssolog-event'),
						(this._reportBody = new o()),
						(this._version = a.version || ''),
						(this.MIN_THRESHOLD = 20),
						(this.MAX_THRESHOLD = 100),
						(this.WAITING_TIME = 6e4),
						(this.INTERVAL = 2e4),
						(this._timerID = 0),
						this._resetLastReportTime(),
						this._startReportTimer(),
						(this._retryCount = 0),
						(this.MAX_RETRY_COUNT = 3);
				}
				reportAtOnce() {
					i.default.debug('EventStatController.reportAtOnce'),
						this._report();
				}
				pushIn(t) {
					t instanceof s.default &&
						(t.setCommonInfo({
							SDKAppID: Number(
								sessionStorage.getItem('sdkAppId')
							),
							version: this._version,
							userID: sessionStorage.getItem('userId'),
						}),
						this._reportBody.pushIn(t),
						this._report());
				}
				_resetLastReportTime() {
					this._lastReportTime = Date.now();
				}
				_startReportTimer() {
					this._timerID = setInterval(() => {
						Date.now() < this._lastReportTime + this.WAITING_TIME ||
							this._reportBody.isEmpty() ||
							this._report();
					}, this.INTERVAL);
				}
				_stopReportTimer() {
					this._timerID > 0 &&
						(clearInterval(this._timerID), (this._timerID = 0));
				}
				_report() {
					if (this._reportBody.isEmpty()) return;
					const t = Math.ceil(+new Date() / 1e3),
						e = sessionStorage.getItem('sdkAppId'),
						n = this._reportBody.getLogsInMemory(),
						o = { table: this._reportBody.getTable(), report: n },
						s = `${c.CURRENT.COMMON}/${h.imopenstat}/${d.IM_OPEN_STAT}/${f.TIM_WEB_TRTCCALLING_REPORT}/?sdkappid=${e}&reqtime=${t}`;
					u.a
						.post(s, JSON.stringify(o))
						.then(() => {
							this._resetLastReportTime(),
								this._retryCount > 0 &&
									(i.default.debug(
										'EventStatController.report retry success'
									),
									(this._retryCount = 0));
						})
						.catch((t) => {
							i.default.warn(
								'EventStatController.report, error:' +
									Object(r.stringifyError)(t)
							),
								this._reportBody.backfill(n);
							this._reportBody.getLogsNumInMemory() >
								this.MAX_THRESHOLD ||
							this._retryCount === this.MAX_RETRY_COUNT ||
							0 === this._timerID
								? (this._retryCount = 0)
								: (this._retryCount += 1);
						});
				}
				reset() {
					i.default.log('EventStatController.reset'),
						this._stopReportTimer(),
						this._report();
				}
			}
		},
		function(t) {
			t.exports = JSON.parse(
				'{"name":"trtc-calling-js","version":"1.0.0","description":"腾讯云 TRTC CALLING SDK","main":"index","dependencies":{"axios":"^0.21.0","EventEmitter":"^1.0.0","tim-js-sdk":"^2.13.1","trtc-js-sdk":"^4.11.5","tsignaling":"^0.7.0"},"devDependencies":{"@babel/preset-typescript":"^7.12.7","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","docdash-blue":"^1.1.3","eslint":"^7.27.0","eslint-config-google":"^0.14.0","fs-extra":"^9.0.1","jsdoc":"^3.6.5","pretty":"^2.0.0","replace":"^1.2.0","ts-loader":"^8.0.2","typescript":"^3.9.7","webpack":"^4.44.1","webpack-cli":"^3.3.12"},"scripts":{"build":"webpack --config webpack.config.js","build_withcopy":"npm run build && cp dist/npm/trtc-calling-js.js ../TIM-demo-web/node_modules/trtc-calling-js/trtc-calling-js.js","build_withcopy2":"npm run build && cp dist/npm/trtc-calling-js.js ../trtc-calling-webrtc-demo/node_modules/trtc-calling-js/trtc-calling-js.js","build:package":"node build/package-bundle.js","lint":"./node_modules/.bin/eslint ./src; exit 0","fix":"./node_modules/.bin/eslint --fix ./src; exit 0","prerelease":"npm run lint && npm run build && npm run doc && npm run build:package","ts2js":"tsc src/index.ts --outDir build/ts2js --lib es2015,DOM","doc":"npm run ts2js && npm run doc:clean && npm run doc:build","doc:build":"./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/CHANGELOG.md"},"repository":{"type":"git","url":"git@git.code.oa.com:TRDCWeb/trtc-calling-webrtc.git"},"author":"Tencent Cloud Terminal R&D Center","license":"ISC"}'
			);
		},
		function(e, n) {
			e.exports = t;
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t, e) {
				return function() {
					for (
						var n = new Array(arguments.length), i = 0;
						i < n.length;
						i++
					)
						n[i] = arguments[i];
					return t.apply(e, n);
				};
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			function r(t) {
				return encodeURIComponent(t)
					.replace(/%3A/gi, ':')
					.replace(/%24/g, '$')
					.replace(/%2C/gi, ',')
					.replace(/%20/g, '+')
					.replace(/%5B/gi, '[')
					.replace(/%5D/gi, ']');
			}
			t.exports = function(t, e, n) {
				if (!e) return t;
				var o;
				if (n) o = n(e);
				else if (i.isURLSearchParams(e)) o = e.toString();
				else {
					var s = [];
					i.forEach(e, function(t, e) {
						null != t &&
							(i.isArray(t) ? (e += '[]') : (t = [t]),
							i.forEach(t, function(t) {
								i.isDate(t)
									? (t = t.toISOString())
									: i.isObject(t) && (t = JSON.stringify(t)),
									s.push(r(e) + '=' + r(t));
							}));
					}),
						(o = s.join('&'));
				}
				if (o) {
					var a = t.indexOf('#');
					-1 !== a && (t = t.slice(0, a)),
						(t += (-1 === t.indexOf('?') ? '?' : '&') + o);
				}
				return t;
			};
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t) {
				return !(!t || !t.__CANCEL__);
			};
		},
		function(t, e, n) {
			'use strict';
			(function(e) {
				var i = n(2),
					r = n(33),
					o = { 'Content-Type': 'application/x-www-form-urlencoded' };
				function s(t, e) {
					!i.isUndefined(t) &&
						i.isUndefined(t['Content-Type']) &&
						(t['Content-Type'] = e);
				}
				var a,
					l = {
						adapter:
							(('undefined' != typeof XMLHttpRequest ||
								(void 0 !== e &&
									'[object process]' ===
										Object.prototype.toString.call(e))) &&
								(a = n(16)),
							a),
						transformRequest: [
							function(t, e) {
								return (
									r(e, 'Accept'),
									r(e, 'Content-Type'),
									i.isFormData(t) ||
									i.isArrayBuffer(t) ||
									i.isBuffer(t) ||
									i.isStream(t) ||
									i.isFile(t) ||
									i.isBlob(t)
										? t
										: i.isArrayBufferView(t)
										? t.buffer
										: i.isURLSearchParams(t)
										? (s(
												e,
												'application/x-www-form-urlencoded;charset=utf-8'
										  ),
										  t.toString())
										: i.isObject(t)
										? (s(
												e,
												'application/json;charset=utf-8'
										  ),
										  JSON.stringify(t))
										: t
								);
							},
						],
						transformResponse: [
							function(t) {
								if ('string' == typeof t)
									try {
										t = JSON.parse(t);
									} catch (t) {}
								return t;
							},
						],
						timeout: 0,
						xsrfCookieName: 'XSRF-TOKEN',
						xsrfHeaderName: 'X-XSRF-TOKEN',
						maxContentLength: -1,
						maxBodyLength: -1,
						validateStatus: function(t) {
							return t >= 200 && t < 300;
						},
					};
				(l.headers = {
					common: { Accept: 'application/json, text/plain, */*' },
				}),
					i.forEach(['delete', 'get', 'head'], function(t) {
						l.headers[t] = {};
					}),
					i.forEach(['post', 'put', 'patch'], function(t) {
						l.headers[t] = i.merge(o);
					}),
					(t.exports = l);
			}.call(this, n(32)));
		},
		function(t, e, n) {
			'use strict';
			var i = n(2),
				r = n(34),
				o = n(36),
				s = n(13),
				a = n(37),
				l = n(40),
				u = n(41),
				c = n(17);
			t.exports = function(t) {
				return new Promise(function(e, n) {
					var d = t.data,
						f = t.headers;
					i.isFormData(d) && delete f['Content-Type'];
					var h = new XMLHttpRequest();
					if (t.auth) {
						var p = t.auth.username || '',
							_ = t.auth.password
								? unescape(encodeURIComponent(t.auth.password))
								: '';
						f.Authorization = 'Basic ' + btoa(p + ':' + _);
					}
					var g = a(t.baseURL, t.url);
					if (
						(h.open(
							t.method.toUpperCase(),
							s(g, t.params, t.paramsSerializer),
							!0
						),
						(h.timeout = t.timeout),
						(h.onreadystatechange = function() {
							if (
								h &&
								4 === h.readyState &&
								(0 !== h.status ||
									(h.responseURL &&
										0 === h.responseURL.indexOf('file:')))
							) {
								var i =
										'getAllResponseHeaders' in h
											? l(h.getAllResponseHeaders())
											: null,
									o = {
										data:
											t.responseType &&
											'text' !== t.responseType
												? h.response
												: h.responseText,
										status: h.status,
										statusText: h.statusText,
										headers: i,
										config: t,
										request: h,
									};
								r(e, n, o), (h = null);
							}
						}),
						(h.onabort = function() {
							h &&
								(n(c('Request aborted', t, 'ECONNABORTED', h)),
								(h = null));
						}),
						(h.onerror = function() {
							n(c('Network Error', t, null, h)), (h = null);
						}),
						(h.ontimeout = function() {
							var e = 'timeout of ' + t.timeout + 'ms exceeded';
							t.timeoutErrorMessage &&
								(e = t.timeoutErrorMessage),
								n(c(e, t, 'ECONNABORTED', h)),
								(h = null);
						}),
						i.isStandardBrowserEnv())
					) {
						var I =
							(t.withCredentials || u(g)) && t.xsrfCookieName
								? o.read(t.xsrfCookieName)
								: void 0;
						I && (f[t.xsrfHeaderName] = I);
					}
					if (
						('setRequestHeader' in h &&
							i.forEach(f, function(t, e) {
								void 0 === d &&
								'content-type' === e.toLowerCase()
									? delete f[e]
									: h.setRequestHeader(e, t);
							}),
						i.isUndefined(t.withCredentials) ||
							(h.withCredentials = !!t.withCredentials),
						t.responseType)
					)
						try {
							h.responseType = t.responseType;
						} catch (e) {
							if ('json' !== t.responseType) throw e;
						}
					'function' == typeof t.onDownloadProgress &&
						h.addEventListener('progress', t.onDownloadProgress),
						'function' == typeof t.onUploadProgress &&
							h.upload &&
							h.upload.addEventListener(
								'progress',
								t.onUploadProgress
							),
						t.cancelToken &&
							t.cancelToken.promise.then(function(t) {
								h && (h.abort(), n(t), (h = null));
							}),
						d || (d = null),
						h.send(d);
				});
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(35);
			t.exports = function(t, e, n, r, o) {
				var s = new Error(t);
				return i(s, e, n, r, o);
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			t.exports = function(t, e) {
				e = e || {};
				var n = {},
					r = ['url', 'method', 'data'],
					o = ['headers', 'auth', 'proxy', 'params'],
					s = [
						'baseURL',
						'transformRequest',
						'transformResponse',
						'paramsSerializer',
						'timeout',
						'timeoutMessage',
						'withCredentials',
						'adapter',
						'responseType',
						'xsrfCookieName',
						'xsrfHeaderName',
						'onUploadProgress',
						'onDownloadProgress',
						'decompress',
						'maxContentLength',
						'maxBodyLength',
						'maxRedirects',
						'transport',
						'httpAgent',
						'httpsAgent',
						'cancelToken',
						'socketPath',
						'responseEncoding',
					],
					a = ['validateStatus'];
				function l(t, e) {
					return i.isPlainObject(t) && i.isPlainObject(e)
						? i.merge(t, e)
						: i.isPlainObject(e)
						? i.merge({}, e)
						: i.isArray(e)
						? e.slice()
						: e;
				}
				function u(r) {
					i.isUndefined(e[r])
						? i.isUndefined(t[r]) || (n[r] = l(void 0, t[r]))
						: (n[r] = l(t[r], e[r]));
				}
				i.forEach(r, function(t) {
					i.isUndefined(e[t]) || (n[t] = l(void 0, e[t]));
				}),
					i.forEach(o, u),
					i.forEach(s, function(r) {
						i.isUndefined(e[r])
							? i.isUndefined(t[r]) || (n[r] = l(void 0, t[r]))
							: (n[r] = l(void 0, e[r]));
					}),
					i.forEach(a, function(i) {
						i in e
							? (n[i] = l(t[i], e[i]))
							: i in t && (n[i] = l(void 0, t[i]));
					});
				var c = r
						.concat(o)
						.concat(s)
						.concat(a),
					d = Object.keys(t)
						.concat(Object.keys(e))
						.filter(function(t) {
							return -1 === c.indexOf(t);
						});
				return i.forEach(d, u), n;
			};
		},
		function(t, e, n) {
			'use strict';
			function i(t) {
				this.message = t;
			}
			(i.prototype.toString = function() {
				return 'Cancel' + (this.message ? ': ' + this.message : '');
			}),
				(i.prototype.__CANCEL__ = !0),
				(t.exports = i);
		},
		function(t, e, n) {
			'use strict';
			Object.defineProperty(e, '__esModule', { value: !0 }),
				(e.EVENT = void 0),
				(e.EVENT = {
					ERROR: 'onError',
					INVITED: 'onInvited',
					USER_ACCEPT: 'onUserAccept',
					USER_ENTER: 'onUserEnter',
					USER_LEAVE: 'onUserLeave',
					REJECT: 'onReject',
					NO_RESP: 'onNoResp',
					LINE_BUSY: 'onLineBusy',
					CALLING_CANCEL: 'onCallingCancel',
					KICKED_OUT: 'onKickedOut',
					CALLING_TIMEOUT: 'onCallingTimeout',
					CALL_END: 'onCallEnd',
					CALLING_END: 'onCallEnd',
					USER_VIDEO_AVAILABLE: 'onUserVideoAvailable',
					USER_AUDIO_AVAILABLE: 'onUserAudioAvailable',
					USER_VOICE_VOLUME: 'onUserVoiceVolume',
					GROUP_CALL_INVITEE_LIST_UPDATE:
						'onGroupCallInviteeListUpdate',
					SDK_READY: 'sdkReady',
				});
		},
		function(t, e, n) {
			'use strict';
			Object.defineProperty(e, '__esModule', { value: !0 });
			e.default = {
				NO_SDK_APPID: '无 SDKAppID',
				NO_ACCOUNT_TYPE: '无 accountType',
				NO_IDENTIFIER: '无 userID',
				NO_USER_SIG: '无 userSig',
				NO_NETWORK: '未连接到网络',
			};
		},
		function(t, e, n) {
			t.exports = n(27);
		},
		function(t, e, n) {
			'use strict';
			var i =
					(this && this.__assign) ||
					function() {
						return (i =
							Object.assign ||
							function(t) {
								for (
									var e, n = 1, i = arguments.length;
									n < i;
									n++
								)
									for (var r in (e = arguments[n]))
										Object.prototype.hasOwnProperty.call(
											e,
											r
										) && (t[r] = e[r]);
								return t;
							}).apply(this, arguments);
					},
				r =
					(this && this.__awaiter) ||
					function(t, e, n, i) {
						return new (n || (n = Promise))(function(r, o) {
							function s(t) {
								try {
									l(i.next(t));
								} catch (t) {
									o(t);
								}
							}
							function a(t) {
								try {
									l(i.throw(t));
								} catch (t) {
									o(t);
								}
							}
							function l(t) {
								var e;
								t.done
									? r(t.value)
									: ((e = t.value),
									  e instanceof n
											? e
											: new n(function(t) {
													t(e);
											  })).then(s, a);
							}
							l((i = i.apply(t, e || [])).next());
						});
					},
				o =
					(this && this.__generator) ||
					function(t, e) {
						var n,
							i,
							r,
							o,
							s = {
								label: 0,
								sent: function() {
									if (1 & r[0]) throw r[1];
									return r[1];
								},
								trys: [],
								ops: [],
							};
						return (
							(o = { next: a(0), throw: a(1), return: a(2) }),
							'function' == typeof Symbol &&
								(o[Symbol.iterator] = function() {
									return this;
								}),
							o
						);
						function a(o) {
							return function(a) {
								return (function(o) {
									if (n)
										throw new TypeError(
											'Generator is already executing.'
										);
									for (; s; )
										try {
											if (
												((n = 1),
												i &&
													(r =
														2 & o[0]
															? i.return
															: o[0]
															? i.throw ||
															  ((r = i.return) &&
																	r.call(i),
															  0)
															: i.next) &&
													!(r = r.call(i, o[1])).done)
											)
												return r;
											switch (
												((i = 0),
												r && (o = [2 & o[0], r.value]),
												o[0])
											) {
												case 0:
												case 1:
													r = o;
													break;
												case 4:
													return (
														s.label++,
														{
															value: o[1],
															done: !1,
														}
													);
												case 5:
													s.label++,
														(i = o[1]),
														(o = [0]);
													continue;
												case 7:
													(o = s.ops.pop()),
														s.trys.pop();
													continue;
												default:
													if (
														!((r = s.trys),
														(r =
															r.length > 0 &&
															r[r.length - 1]) ||
															(6 !== o[0] &&
																2 !== o[0]))
													) {
														s = 0;
														continue;
													}
													if (
														3 === o[0] &&
														(!r ||
															(o[1] > r[0] &&
																o[1] < r[3]))
													) {
														s.label = o[1];
														break;
													}
													if (
														6 === o[0] &&
														s.label < r[1]
													) {
														(s.label = r[1]),
															(r = o);
														break;
													}
													if (r && s.label < r[2]) {
														(s.label = r[2]),
															s.ops.push(o);
														break;
													}
													r[2] && s.ops.pop(),
														s.trys.pop();
													continue;
											}
											o = e.call(t, s);
										} catch (t) {
											(o = [6, t]), (i = 0);
										} finally {
											n = r = 0;
										}
									if (5 & o[0]) throw o[1];
									return {
										value: o[0] ? o[1] : void 0,
										done: !0,
									};
								})([o, a]);
							};
						}
					},
				s =
					(this && this.__spreadArrays) ||
					function() {
						for (var t = 0, e = 0, n = arguments.length; e < n; e++)
							t += arguments[e].length;
						var i = Array(t),
							r = 0;
						for (e = 0; e < n; e++)
							for (
								var o = arguments[e], s = 0, a = o.length;
								s < a;
								s++, r++
							)
								i[r] = o[s];
						return i;
					};
			Object.defineProperty(e, '__esModule', { value: !0 });
			var a = n(24),
				l = n(0),
				u = n(25),
				c = n(11),
				d = n(45),
				f = n(46),
				h = n(48),
				p = n(20),
				_ = n(6),
				g = n(8),
				I = n(9),
				m = n(5),
				C = n(49),
				v = n(1),
				E = n(7),
				T = n(50),
				y = n(51),
				S = n(4),
				L = n(10),
				D = 'TRTCCalling',
				A = (function() {
					function t(t) {
						(this._sdkAppID = t.SDKAppID),
							(this._trtcClient = null),
							(this._userID = ''),
							(this._userSig = ''),
							(this._switchCallModeStatus = !0),
							(this._inviterInviteID = []),
							(this._callTimeout = 30),
							(this._callStatus = E.CALL_STATUS.IDLE),
							(this._callType = E.CALL_TYPE.UNKNOWN),
							(this._roomID = 0),
							(this._isInviter = !1),
							(this._isGroupCall = !1),
							(this._groupCallStatus = !1),
							(this._inviteeList = []),
							(this._unHandledInviteeList = []),
							sessionStorage.setItem(
								'sdkAppId',
								'' + this._sdkAppID
							),
							(this._netMonitor = new C.default()),
							(this._outerEmitter = new a.default()),
							(this._delegate = new h.default(
								this._outerEmitter
							)),
							(this.tim = t.tim || d.create(t)),
							(this._tsignalingClient = new f.default(
								this,
								i({ tim: this.tim }, t)
							)),
							(this._quality = '480p');
						var e = new _.default(g.default.SDK_CONSTRUCT);
						(this._eventStatController = new I.default()),
							_.default.bindController(this._eventStatController),
							e
								.setText(
									'version=' +
										L.version +
										'-ua=' +
										m.USER_AGENT
								)
								.setEnd(),
							v.default.info(
								D +
									' SDK Version:' +
									L.version +
									', SDKAppID:' +
									t.SDKAppID +
									', UserAgent:' +
									m.USER_AGENT
							);
					}
					return (
						(t.prototype.getUserID = function() {
							return this._userID;
						}),
						(t.prototype.getCallType = function() {
							return this._callType;
						}),
						(t.prototype.setCallType = function(t) {
							this._callType = t;
						}),
						(t.prototype.isInviter = function() {
							return this._isInviter;
						}),
						(t.prototype.getInviteeList = function() {
							return this._inviteeList;
						}),
						(t.prototype.setInviteeList = function(t) {
							this._inviteeList = s(t);
						}),
						(t.prototype.getUnHandledInviteeList = function() {
							return this._unHandledInviteeList;
						}),
						(t.prototype.setUnHandledInviteeList = function(t) {
							(this._unHandledInviteeList = s(t)),
								v.default.debug(
									D + '.setUnHandledInviteeList',
									this._unHandledInviteeList
								);
						}),
						(t.prototype.isGroupCall = function() {
							return this._isGroupCall;
						}),
						(t.prototype.setIsGroupCall = function(t) {
							this._isGroupCall = t;
						}),
						(t.prototype.getGroupID = function() {
							return this._groupID;
						}),
						(t.prototype.setGroupID = function(t) {
							this._groupID = t;
						}),
						(t.prototype.hasRemoteConnectedUsers = function() {
							return this.getRemoteStreamCount() > 0;
						}),
						(t.prototype.getRemoteStreamCount = function() {
							return this._trtcClient
								? this._trtcClient.getRemoteStreams().length
								: 0;
						}),
						(t.prototype.setLogLevel = function(t) {
							v.default.setLevel(t),
								this._tsignalingClient.setLogLevel(t),
								c.Logger.setLogLevel(t + 1);
						}),
						(t.prototype.on = function(t, e, n) {
							this._outerEmitter.on(t, e, n || this);
						}),
						(t.prototype.off = function(t, e, n) {
							this._outerEmitter.off(t, e, n || this);
						}),
						(t.prototype.login = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i;
								return o(this, function(r) {
									switch (r.label) {
										case 0:
											v.default.debug(
												D + '.login - params:',
												t
											),
												this._netMonitor.start(),
												(e = t.userID),
												(n = t.userSig),
												(this._userID = e),
												(this._userSig = n),
												(this._trtcClient = new u.default(
													{
														sdkAppID: this
															._sdkAppID,
														userID: e,
														userSig: n,
														trtcCalling: this,
													}
												)),
												sessionStorage.setItem(
													'userId',
													'' + this._userID
												),
												(r.label = 1);
										case 1:
											return (
												r.trys.push([1, 3, , 4]),
												[
													4,
													this._tsignalingClient.login(
														{
															userID: e,
															userSig: n,
														}
													),
												]
											);
										case 2:
											return (
												r.sent(),
												this._setInterfaceUpLoad(
													g.default.LOGIN
												)
													.setText(
														'userId: ' +
															this._userID +
															' login succeeded'
													)
													.setEnd(),
												[3, 4]
											);
										case 3:
											return (
												(i = r.sent()),
												console.log(i),
												this._setInterfaceUpLoad(
													g.default.LOGIN
												)
													.setText(
														'userId: ' +
															this._userID +
															' login failed, error: ' +
															i
													)
													.setEnd(),
												[3, 4]
											);
										case 4:
											return [2];
									}
								});
							});
						}),
						(t.prototype.logout = function() {
							return r(this, void 0, void 0, function() {
								return o(this, function(t) {
									return (
										v.default.debug(D + '.logout'),
										this._setInterfaceUpLoad(
											g.default.LOGOUT
										)
											.setText(
												'userId: ' +
													this._userID +
													' logout'
											)
											.setEnd(),
										(this._userID = ''),
										(this._userSig = ''),
										this._resetTRTCClient(),
										(this._trtcClient = null),
										[2, this._tsignalingClient.logout()]
									);
								});
							});
						}),
						(t.prototype.call = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r, s, a;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											if (
												this._callStatus !==
												E.CALL_STATUS.IDLE
											)
												return (
													v.default.log(
														D +
															'.call - CALL_STATUS:',
														this._callStatus
													),
													[2]
												);
											o.label = 1;
										case 1:
											return (
												o.trys.push([1, 3, , 4]),
												[
													4,
													navigator.mediaDevices.getUserMedia(
														{
															audio: !0,
															video:
																t.type ===
																E.CALL_TYPE
																	.VIDEO_CALL,
														}
													),
												]
											);
										case 2:
											return o.sent(), [3, 4];
										case 3:
											return (
												(e = o.sent()),
												this._delegate.onError(
													S.default.NOT_MEDIA_ACCESS,
													JSON.stringify(e)
												),
												v.default.error(
													D +
														'.call - user media failure'
												),
												[2]
											);
										case 4:
											return (
												v.default.debug(
													D + '.call - params:',
													t
												),
												(n = t.userID),
												(i = t.type),
												(r = t.offlinePushInfo),
												(this._callStatus =
													E.CALL_STATUS.CALLING),
												(this._callType = i),
												(this._isInviter = !0),
												(this._inviterID = this._userID),
												(this._inviteeID = n),
												(this._isGroupCall = !1),
												(this._groupID = ''),
												(this._roomID = l.generateRandomRoomID()),
												[
													4,
													this._tsignalingClient.invite(
														{
															userID: n,
															type: i,
															roomID: this
																._roomID,
															timeout: this
																._callTimeout,
															offlinePushInfo: r,
														}
													),
												]
											);
										case 5:
											return (
												(s = o.sent()),
												(a =
													'callType: ' +
													(i + 1) +
													', \n      conversationType: ' +
													s.data.message
														.conversationType +
													', \n      userId:{ ' +
													s.data.message.from +
													' } invite userId:{ ' +
													s.data.message.to +
													' }'),
												0 === s.code
													? (this.setInviterInviteID(
															s.inviteID
													  ),
													  this._setInterfaceUpLoad(
															g.default.CALL
													  )
															.setCallType(i + 1)
															.setText(
																a + ' succeeded'
															)
															.setEnd())
													: this._setInterfaceUpLoad(
															g.default.CALL
													  )
															.setCallType(i + 1)
															.setText(
																a + ' failed'
															)
															.setEnd(),
												[2, s]
											);
									}
								});
							});
						}),
						(t.prototype.setInviterInviteID = function(t) {
							this._inviterInviteID = s(this._inviterInviteID, [
								t,
							]);
						}),
						(t.prototype.getInviterInviteID = function() {
							return this._inviterInviteID;
						}),
						(t.prototype.delInviterInviteID = function(t) {
							this._inviterInviteID = this._inviterInviteID.filter(
								function(e) {
									return e !== t;
								}
							);
						}),
						(t.prototype._setInterfaceUpLoad = function(t) {
							return v.default.time(t), new _.default(t);
						}),
						(t.prototype.getInviterID = function() {
							return this._inviterID;
						}),
						(t.prototype.setInviterID = function(t) {
							this._inviterID = t;
						}),
						(t.prototype.groupCall = function(t) {
							return r(this, void 0, void 0, function() {
								var e,
									n,
									i,
									r,
									s,
									a,
									u,
									c = this;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											if (this._groupCallStatus)
												return (
													v.default.log(
														D +
															'.groupCall - calling'
													),
													[2]
												);
											o.label = 1;
										case 1:
											return (
												o.trys.push([1, 3, , 4]),
												[
													4,
													navigator.mediaDevices.getUserMedia(
														{
															audio: !0,
															video:
																t.type ===
																E.CALL_TYPE
																	.VIDEO_CALL,
														}
													),
												]
											);
										case 2:
											return o.sent(), [3, 4];
										case 3:
											return (
												(e = o.sent()),
												this._delegate.onError(
													S.default.NOT_MEDIA_ACCESS,
													JSON.stringify(e)
												),
												v.default.error(
													D +
														'.groupCall - user media failure'
												),
												[2]
											);
										case 4:
											return (
												(this._groupCallStatus = !0),
												v.default.debug(
													D + '.groupCall - params:',
													t
												),
												(n = t.userIDList),
												(i = t.type),
												(r = t.groupID),
												(s = t.offlinePushInfo),
												(this._callType = i),
												(this._isInviter = !0),
												(this._isGroupCall = !0),
												(this._inviterID = this._userID),
												(this._groupID = r || ''),
												this.setInviteeList(n),
												this.setUnHandledInviteeList(n),
												this._roomID ||
													((this._roomID = l.generateRandomRoomID()),
													(this._callStatus =
														E.CALL_STATUS.CALLING)),
												[
													4,
													this._tsignalingClient.inviteInGroup(
														{
															groupID: this
																._groupID,
															userIDList: n,
															type: i,
															roomID: this
																._roomID,
															timeout: this
																._callTimeout,
															offlinePushInfo: s,
														}
													),
												]
											);
										case 5:
											return (
												(a = o.sent()),
												v.default.log(
													'groupCall res',
													a
												),
												r
													? ((u =
															'callType: ' +
															(i + 1) +
															',\n      conversationType: ' +
															a.data.message
																.conversationType +
															',\n      userId:{ ' +
															a.data.message
																.from +
															' } invite { ' +
															a.data.message.to +
															': ' +
															n +
															' }'),
													  0 === a.code
															? (this.setInviterInviteID(
																	a.inviteID
															  ),
															  this._setInterfaceUpLoad(
																	g.default
																		.GROUP_CALL
															  )
																	.setCallType(
																		i + 1
																	)
																	.setText(
																		u +
																			'  succeeded'
																	)
																	.setEnd())
															: this._setInterfaceUpLoad(
																	g.default
																		.GROUP_CALL
															  )
																	.setCallType(
																		i + 1
																	)
																	.setText(
																		u +
																			'  failed'
																	)
																	.setEnd())
													: ((u =
															'callType: ' +
															(i + 1) +
															',\n      result: ' +
															JSON.stringify(a)),
													  0 === a.code
															? (a.data.map(
																	function(
																		t
																	) {
																		c.setInviterInviteID(
																			t.inviteID
																		);
																	}
															  ),
															  this._setInterfaceUpLoad(
																	g.default
																		.GROUP_CALL
															  )
																	.setCallType(
																		i + 1
																	)
																	.setText(
																		u +
																			'  succeeded'
																	)
																	.setEnd())
															: this._setInterfaceUpLoad(
																	g.default
																		.GROUP_CALL
															  )
																	.setCallType(
																		i + 1
																	)
																	.setText(
																		u +
																			'  failed'
																	)
																	.setEnd()),
												(this._groupCallStatus = !1),
												[2, a]
											);
									}
								});
							});
						}),
						(t.prototype.accept = function() {
							return r(this, void 0, void 0, function() {
								var t,
									e,
									n,
									i,
									r,
									s,
									a,
									l,
									u,
									c,
									d = this;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											if (
												(v.default.debug(D + '.accept'),
												!this._tsignalingClient.getInviteData())
											)
												return (
													v.default.warn(
														D +
															'.accept - there are no calls to accept'
													),
													[2]
												);
											(t = this._tsignalingClient.getInviteData()),
												(e = t.inviteID),
												(n = t.inviteData),
												(i = n.roomID),
												(r = n.callType),
												v.default.debug(
													D + '.accept - params',
													'inviteID: ' +
														e +
														',callType: ' +
														r +
														',roomID: ' +
														i +
														'.'
												),
												(o.label = 1);
										case 1:
											return (
												o.trys.push([1, 3, , 4]),
												[
													4,
													this._tsignalingClient.accept(
														{
															inviteID: e,
															callType: r,
														}
													),
												]
											);
										case 2:
											return (
												(s = o.sent()),
												(u =
													'callType: ' +
													(r + 1) +
													',\n      conversationType: ' +
													s.data.message
														.conversationType +
													',\n      userId:{ ' +
													this._userID +
													' } accept userId:{ ' +
													s.data.message.to +
													' } succeeded'),
												this._setInterfaceUpLoad(
													g.default.ACCEPT
												)
													.setCallType(r + 1)
													.setText('' + u)
													.setEnd(),
												[3, 4]
											);
										case 3:
											return (
												(a = o.sent()),
												v.default.error(a),
												(u =
													'callType: ' +
													(r + 1) +
													',\n      conversationType: ' +
													s.data.message
														.conversationType +
													',\n      userId:{ ' +
													this._userID +
													' } accept userId:{ ' +
													s.data.message.to +
													' } failed'),
												this._setInterfaceUpLoad(
													g.default.ACCEPT
												)
													.setCallType(r + 1)
													.setText('' + u)
													.setEnd(),
												[2]
											);
										case 4:
											(this._callType = r),
												(this._callStatus =
													E.CALL_STATUS.CONNECTED),
												this.isGroupCall() &&
													((l = this._unHandledInviteeList.filter(
														function(t) {
															return (
																t !== d._userID
															);
														}
													)),
													this.setUnHandledInviteeList(
														l
													),
													(u =
														'callType: ' +
														(r + 1) +
														',\n      conversationType: ' +
														s.data.message
															.conversationType +
														',\n      userId:{ ' +
														this._userID +
														' } accept userId:{ ' +
														s.data.message.to +
														' } succeeded'),
													this._setInterfaceUpLoad(
														g.default.ACCEPT
													)
														.setCallType(r + 1)
														.setText(u)
														.setEnd()),
												(o.label = 5);
										case 5:
											return (
												o.trys.push([5, 7, , 8]),
												[4, this._trtcClient.join(i)]
											);
										case 6:
											return (
												o.sent(),
												(this._roomID = i),
												[3, 8]
											);
										case 7:
											return (
												(c = o.sent()),
												console.error(
													'join room failed! ' + c
												),
												[3, 8]
											);
										case 8:
											return [2, s];
									}
								});
							});
						}),
						(t.prototype.reject = function() {
							return r(this, void 0, void 0, function() {
								var t, e, n, i, r, s, a;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											return (
												v.default.debug(D + '.reject'),
												this._tsignalingClient.getInviteData()
													? ((t =
															this._callStatus ===
															E.CALL_STATUS
																.CONNECTED),
													  v.default.log(
															D +
																'.reject - status:' +
																t
													  ),
													  (e = this._tsignalingClient.getInviteData()),
													  (n = e.inviteID),
													  (i = e.inviteData),
													  (r = i.callType),
													  v.default.debug(
															D +
																'.reject - params',
															'inviteID: ' +
																n +
																',callType: ' +
																r +
																',isBusy: ' +
																t +
																'.'
													  ),
													  [
															4,
															this._tsignalingClient.reject(
																{
																	inviteID: n,
																	callType: r,
																	isBusy: t,
																}
															),
													  ])
													: (v.default.warn(
															D +
																'.reject - there are no calls to reject'
													  ),
													  [2])
											);
										case 1:
											return (
												(s = o.sent()),
												(a =
													'callType: ' +
													(r + 1) +
													',\n    conversationType: ' +
													s.data.message
														.conversationType +
													',\n    userId:{ ' +
													this._userID +
													' } reject userId:{ ' +
													s.data.message.to +
													' } succeeded'),
												this._setInterfaceUpLoad(
													g.default.REJECT
												)
													.setCallType(r + 1)
													.setText(a)
													.setEnd(),
												t || this._resetTRTCClient(),
												[2, s]
											);
									}
								});
							});
						}),
						(t.prototype.hangup = function() {
							return r(this, void 0, void 0, function() {
								var t;
								return o(this, function(e) {
									switch (e.label) {
										case 0:
											return (
												v.default.debug(
													D +
														'. - callStatus:' +
														this._callStatus +
														' inviteID:' +
														this._inviterInviteID
												),
												this._callStatus !==
												E.CALL_STATUS.CALLING
													? [3, 2]
													: (v.default.log(
															'cancel _inviterInviteID',
															this
																._inviterInviteID
													  ),
													  [4, this._cancel()])
											);
										case 1:
											return (t = e.sent()), [3, 5];
										case 2:
											return this._callStatus !==
												E.CALL_STATUS.CONNECTED
												? [3, 5]
												: [4, this._cancel()];
										case 3:
											return (
												e.sent(),
												[4, this._trtcClient.leave()]
											);
										case 4:
											(t = e.sent()),
												this._setInterfaceUpLoad(
													g.default.REJECT
												)
													.setText(
														'userId: ' +
															this._userID +
															' hangup succeeded'
													)
													.setEnd(),
												(e.label = 5);
										case 5:
											return (
												this._resetTRTCClient(), [2, t]
											);
									}
								});
							});
						}),
						(t.prototype._cancel = function() {
							return r(this, void 0, void 0, function() {
								var t, e, n, i, r;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											if (
												(v.default.log(
													'_cancel _inviterInviteID',
													this._inviterInviteID
												),
												0 ===
													this._inviterInviteID
														.length)
											)
												return [2];
											(t = []), (e = 0), (o.label = 1);
										case 1:
											return e <
												this._inviterInviteID.length
												? ((n = this._inviterInviteID[
														e
												  ]),
												  [
														4,
														this._tsignalingClient.cancel(
															{ inviteID: n }
														),
												  ])
												: [3, 4];
										case 2:
											(i = o.sent()),
												t.push(i),
												(o.label = 3);
										case 3:
											return e++, [3, 1];
										case 4:
											return (
												(r =
													'cancel ' +
													JSON.stringify(t) +
													' succeeded'),
												v.default.log(
													D + '._cancel ' + r
												),
												this._setInterfaceUpLoad(
													g.default.CALLING_CANCEL
												)
													.setText(r)
													.setEnd(),
												[2, t]
											);
									}
								});
							});
						}),
						(t.prototype.startRemoteView = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n;
								return o(this, function(i) {
									return (
										v.default.debug(
											D + '.startRemoteView - params:',
											t
										),
										(e = t.userID),
										(n = t.videoViewDomID),
										this._setInterfaceUpLoad(
											g.default.START_REMOTE_VIEW
										)
											.setText(
												'remote userId:{ ' +
													e +
													' } startRemoveView succeeded'
											)
											.setEnd(),
										[
											2,
											this._trtcClient.playVideo({
												domID: n,
												type: 'remote',
												userID: e,
											}),
										]
									);
								});
							});
						}),
						(t.prototype.stopRemoteView = function(t) {
							v.default.debug(D + '.stopRemoteView - params:', t);
							var e = t.userID;
							this._setInterfaceUpLoad(g.default.STOP_REMOTE_VIEW)
								.setText(
									'remote userId:{ ' +
										e +
										' } stopRemoveView succeeded'
								)
								.setEnd(),
								this._trtcClient.stopVideo({
									type: 'remote',
									userID: e,
								});
						}),
						(t.prototype.startLocalView = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n;
								return o(this, function(i) {
									return (
										v.default.debug(
											D + '.startLocalView - params:',
											t
										),
										(e = t.userID),
										(n = t.videoViewDomID),
										this._setInterfaceUpLoad(
											g.default.START_LOCAL_VIEW
										)
											.setText(
												'remote userId:{ ' +
													e +
													' } startLocalView succeeded'
											)
											.setEnd(),
										[
											2,
											this._trtcClient.playVideo({
												domID: n,
												type: 'local',
												userID: e,
											}),
										]
									);
								});
							});
						}),
						(t.prototype.stopLocalView = function(t) {
							v.default.debug(D + '.stopLocalView - params:', t);
							var e = t.userID;
							this._setInterfaceUpLoad(g.default.STOP_LOCAL_VIEW)
								.setText(
									'remote userId:{ ' +
										e +
										' } stopLocalView succeeded'
								)
								.setEnd(),
								this._trtcClient.stopVideo({
									type: 'local',
									userID: e,
								});
						}),
						(t.prototype.openCamera = function() {
							v.default.debug(D + '.openCamera'),
								this._setInterfaceUpLoad(g.default.OPEN_CAMERA)
									.setText('open camera')
									.setEnd(),
								this._trtcClient.unMuteLocalVideo();
						}),
						(t.prototype.closeCamera = function() {
							v.default.debug(D + '.closeCamera'),
								this._setInterfaceUpLoad(g.default.CLOSE_CAMERA)
									.setText('close camera')
									.setEnd(),
								this._trtcClient.muteLocalVideo();
						}),
						(t.prototype.setMicMute = function(t) {
							v.default.debug(D + '.setMicMute - isMute:' + t),
								this._setInterfaceUpLoad(g.default.SET_MIC_MUTE)
									.setText('setMicMute: ' + t)
									.setEnd(),
								t
									? this._trtcClient.muteLocalAudio()
									: this._trtcClient.unMuteLocalAudio();
						}),
						(t.prototype.setVideoQuality = function(t) {
							if (
								(!T.isString(t) && !T.isPlainObject(t)) ||
								(T.isString(t) &&
									-1 ===
										E.VALID_VIDEO_PROFILE_LIST.indexOf(
											t.toString()
										))
							) {
								throw new y.default({
									message: 'params validate failed.',
								});
							}
							v.default.debug(
								D +
									'.setVideoQuality - quality:' +
									JSON.stringify(t)
							),
								this._setInterfaceUpLoad(
									g.default.SET_VIDEO_QUALITY
								)
									.setText(
										'setVideoQuality: ' + JSON.stringify(t)
									)
									.setEnd(),
								(this._quality = t || '480p');
						}),
						(t.prototype.getVideoQuality = function() {
							return this._quality;
						}),
						(t.prototype.switchToAudioCall = function() {
							this._callStatus === E.CALL_STATUS.CONNECTED
								? this._isGroupCall
									? v.default.warn(
											D +
												'.switchToAudioCall is not applicable to groupCall.'
									  )
									: this._callType !== E.CALL_TYPE.AUDIO_CALL
									? this._switchCallModeStatus
										? (v.default.log(
												D + '.switchToAudioCall',
												this._inviterID,
												this._inviteeID
										  ),
										  this._setInterfaceUpLoad(
												g.default.SWITCH_TO_AUDIO_CALL
										  )
												.setText('switchToAudioCall')
												.setEnd(),
										  this._tsignalingClient.switchCallMode(
												{
													userID: this._isInviter
														? this._inviteeID
														: this._inviterID,
													call_type: this._callType,
													roomID: this._roomID,
													timeout: this._callTimeout,
													mode: E.MODE_TYPE.AUDIO,
												}
										  ),
										  this.setSwitchCallModeStatus(!1))
										: v.default.warn(
												D +
													' audio and video call switching.'
										  )
									: v.default.warn(
											D +
												' Now the call mode is audio call.'
									  )
								: v.default.warn(
										D +
											'.switchToAudioCall is applicable to connected.'
								  );
						}),
						(t.prototype.setSwitchCallModeStatus = function(t) {
							this._switchCallModeStatus = t;
						}),
						(t.prototype.getSwitchCallModeStatus = function() {
							return this._switchCallModeStatus;
						}),
						(t.prototype.switchToVideoCall = function() {
							this._callStatus === E.CALL_STATUS.CONNECTED
								? this._isGroupCall
									? v.default.warn(
											D +
												'.switchToVideoCall is not applicable to groupCall.'
									  )
									: this._callType !== E.CALL_TYPE.VIDEO_CALL
									? this._switchCallModeStatus
										? (v.default.log(
												D + '.switchToVideoCall',
												this._inviterID,
												this._inviteeID
										  ),
										  this._setInterfaceUpLoad(
												g.default.SWITCH_TO_VIDEO_CALL
										  )
												.setText('switchToVideoCall')
												.setEnd(),
										  this._tsignalingClient.switchCallMode(
												{
													userID: this._isInviter
														? this._inviteeID
														: this._inviterID,
													call_type: this._callType,
													roomID: this._roomID,
													timeout: this._callTimeout,
													mode: E.MODE_TYPE.VIDEO,
												}
										  ),
										  this.setSwitchCallModeStatus(!1))
										: v.default.warn(
												D +
													' audio and video call switching.'
										  )
									: v.default.warn(
											D +
												' Now the call mode is video call.'
									  )
								: v.default.warn(
										D +
											'.switchToVideoCall is applicable to connected.'
								  );
						}),
						(t.prototype.getCameras = function() {
							return r(this, void 0, void 0, function() {
								return o(this, function(t) {
									return (
										v.default.log(D + '.getCameras'),
										[2, this._trtcClient.getCamera()]
									);
								});
							});
						}),
						(t.prototype.getMicrophones = function() {
							return r(this, void 0, void 0, function() {
								return o(this, function(t) {
									return (
										v.default.log(D + '.getCameras'),
										[2, this._trtcClient.getMicrophone()]
									);
								});
							});
						}),
						(t.prototype.switchDevice = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n;
								return o(this, function(i) {
									return (
										(e = t.deviceType),
										(n = t.deviceId),
										v.default.debug(
											D +
												'.switchDevice -params: deviceType:' +
												e +
												',deviceID:' +
												n
										),
										[2, this._trtcClient.switchDevice(e, n)]
									);
								});
							});
						}),
						(t.prototype._resetTRTCClient = function() {
							v.default.debug(D + '._resetTRTCClient'),
								(this._roomID = null),
								(this._isInviter = !1),
								(this._isGroupCall = !1),
								this.setSwitchCallModeStatus(!0),
								(this._groupID = ''),
								(this._callStatus = E.CALL_STATUS.IDLE),
								(this._inviteeList = []),
								(this._unHandledInviteeList = []),
								(this._inviterInviteID = []),
								this._tsignalingClient.resetJoined(),
								this._tsignalingClient.setInviteData(null);
							var t = document.getElementById(
								'_trtc_calling_layer'
							);
							t && (t.innerHTML = '');
						}),
						(t.prototype.getCallStatus = function() {
							return this._callStatus;
						}),
						(t.prototype.changeCallStatus = function(t) {
							this._callStatus !== t &&
								(v.default.debug(
									D +
										'.changeCallStatus from ' +
										this._callStatus +
										' to ' +
										t
								),
								this._setInterfaceUpLoad(
									g.default.CHANGE_CALL_STATUS
								)
									.setText(
										'changeCallStatus from ' +
											this._callStatus +
											' to ' +
											t
									)
									.setEnd(),
								(this._callStatus = t));
						}),
						(t.prototype.extractCallingInfoFromMessage = function(
							t
						) {
							if (!t) return '';
							if ('TIMCustomElem' !== t.type) return '';
							var e = JSON.parse(t.payload.data);
							if (
								(v.default.debug(
									D +
										'.extractCallingInfoFromMessage - signalingData:',
									t.payload.data
								),
								e.businessID !== E.BUSINESS_ID.SIGNAL)
							)
								return '';
							switch (e.actionType) {
								case E.ACTION_TYPE.INVITE:
									var n = JSON.parse(e.data);
									return n.call_end > 0
										? '结束通话，通话时长：' +
												l.formatDuration(n.call_end)
										: 0 !== n.call_end && n.room_id
										? '发起通话'
										: '结束群聊';
								case E.ACTION_TYPE.CANCEL_INVITE:
									return '取消通话';
								case E.ACTION_TYPE.ACCEPT_INVITE:
									return '已接听';
								case E.ACTION_TYPE.REJECT_INVITE:
									return '拒绝通话';
								case E.ACTION_TYPE.INVITE_TIMEOUT:
									return '无应答';
								default:
									return '';
							}
						}),
						(t.EVENT = p.EVENT),
						(t.CALL_TYPE = E.CALL_TYPE),
						t
					);
				})();
			e.default = A;
		},
		function(t, e, n) {
			'use strict';
			n.r(e),
				n.d(e, 'default', function() {
					return s;
				});
			const i = Function.prototype.apply,
				r = new WeakMap();
			function o(t) {
				return r.has(t) || r.set(t, {}), r.get(t);
			}
			class s {
				constructor(t = null, e = console) {
					const n = o(this);
					return (
						(n._events = new Set()),
						(n._callbacks = {}),
						(n._console = e),
						(n._maxListeners = null === t ? null : parseInt(t, 10)),
						this
					);
				}
				_addCallback(t, e, n, i) {
					return (
						this._getCallbacks(t).push({
							callback: e,
							context: n,
							weight: i,
						}),
						this._getCallbacks(t).sort(
							(t, e) => t.weight > e.weight
						),
						this
					);
				}
				_getCallbacks(t) {
					return o(this)._callbacks[t];
				}
				_getCallbackIndex(t, e) {
					return this._has(t)
						? this._getCallbacks(t).findIndex(
								(t) => t.callback === e
						  )
						: null;
				}
				_achieveMaxListener(t) {
					return (
						null !== o(this)._maxListeners &&
						o(this)._maxListeners <= this.listenersNumber(t)
					);
				}
				_callbackIsExists(t, e, n) {
					const i = this._getCallbackIndex(t, e),
						r = -1 !== i ? this._getCallbacks(t)[i] : void 0;
					return -1 !== i && r && r.context === n;
				}
				_has(t) {
					return o(this)._events.has(t);
				}
				on(t, e, n = null, i = 1) {
					const r = o(this);
					if ('function' != typeof e)
						throw new TypeError(e + ' is not a function');
					return (
						this._has(t)
							? (this._achieveMaxListener(t) &&
									r._console.warn(
										`Max listeners (${r._maxListeners}) for event "${t}" is reached!`
									),
							  this._callbackIsExists(...arguments) &&
									r._console.warn(
										`Event "${t}" already has the callback ${e}.`
									))
							: (r._events.add(t), (r._callbacks[t] = [])),
						this._addCallback(...arguments),
						this
					);
				}
				once(t, e, n = null, r = 1) {
					const o = (...r) => (this.off(t, o), i.call(e, n, r));
					return this.on(t, o, n, r);
				}
				off(t, e = null) {
					const n = o(this);
					let i;
					return (
						this._has(t) &&
							(null === e
								? (n._events.delete(t),
								  (n._callbacks[t] = null))
								: ((i = this._getCallbackIndex(t, e)),
								  -1 !== i &&
										(n._callbacks[t].splice(i, 1),
										this.off(...arguments)))),
						this
					);
				}
				emit(t, ...e) {
					return (
						this._has(t) &&
							this._getCallbacks(t).forEach((t) =>
								i.call(t.callback, t.context, e)
							),
						this
					);
				}
				clear() {
					const t = o(this);
					return t._events.clear(), (t._callbacks = {}), this;
				}
				listenersNumber(t) {
					return this._has(t) ? this._getCallbacks(t).length : null;
				}
			}
		},
		function(t, e, n) {
			'use strict';
			var i =
					(this && this.__awaiter) ||
					function(t, e, n, i) {
						return new (n || (n = Promise))(function(r, o) {
							function s(t) {
								try {
									l(i.next(t));
								} catch (t) {
									o(t);
								}
							}
							function a(t) {
								try {
									l(i.throw(t));
								} catch (t) {
									o(t);
								}
							}
							function l(t) {
								var e;
								t.done
									? r(t.value)
									: ((e = t.value),
									  e instanceof n
											? e
											: new n(function(t) {
													t(e);
											  })).then(s, a);
							}
							l((i = i.apply(t, e || [])).next());
						});
					},
				r =
					(this && this.__generator) ||
					function(t, e) {
						var n,
							i,
							r,
							o,
							s = {
								label: 0,
								sent: function() {
									if (1 & r[0]) throw r[1];
									return r[1];
								},
								trys: [],
								ops: [],
							};
						return (
							(o = { next: a(0), throw: a(1), return: a(2) }),
							'function' == typeof Symbol &&
								(o[Symbol.iterator] = function() {
									return this;
								}),
							o
						);
						function a(o) {
							return function(a) {
								return (function(o) {
									if (n)
										throw new TypeError(
											'Generator is already executing.'
										);
									for (; s; )
										try {
											if (
												((n = 1),
												i &&
													(r =
														2 & o[0]
															? i.return
															: o[0]
															? i.throw ||
															  ((r = i.return) &&
																	r.call(i),
															  0)
															: i.next) &&
													!(r = r.call(i, o[1])).done)
											)
												return r;
											switch (
												((i = 0),
												r && (o = [2 & o[0], r.value]),
												o[0])
											) {
												case 0:
												case 1:
													r = o;
													break;
												case 4:
													return (
														s.label++,
														{
															value: o[1],
															done: !1,
														}
													);
												case 5:
													s.label++,
														(i = o[1]),
														(o = [0]);
													continue;
												case 7:
													(o = s.ops.pop()),
														s.trys.pop();
													continue;
												default:
													if (
														!((r = s.trys),
														(r =
															r.length > 0 &&
															r[r.length - 1]) ||
															(6 !== o[0] &&
																2 !== o[0]))
													) {
														s = 0;
														continue;
													}
													if (
														3 === o[0] &&
														(!r ||
															(o[1] > r[0] &&
																o[1] < r[3]))
													) {
														s.label = o[1];
														break;
													}
													if (
														6 === o[0] &&
														s.label < r[1]
													) {
														(s.label = r[1]),
															(r = o);
														break;
													}
													if (r && s.label < r[2]) {
														(s.label = r[2]),
															s.ops.push(o);
														break;
													}
													r[2] && s.ops.pop(),
														s.trys.pop();
													continue;
											}
											o = e.call(t, s);
										} catch (t) {
											(o = [6, t]), (i = 0);
										} finally {
											n = r = 0;
										}
									if (5 & o[0]) throw o[1];
									return {
										value: o[0] ? o[1] : void 0,
										done: !0,
									};
								})([o, a]);
							};
						}
					},
				o =
					(this && this.__spreadArrays) ||
					function() {
						for (var t = 0, e = 0, n = arguments.length; e < n; e++)
							t += arguments[e].length;
						var i = Array(t),
							r = 0;
						for (e = 0; e < n; e++)
							for (
								var o = arguments[e], s = 0, a = o.length;
								s < a;
								s++, r++
							)
								i[r] = o[s];
						return i;
					};
			Object.defineProperty(e, '__esModule', { value: !0 });
			var s = n(11),
				a = n(1),
				l = n(7),
				u = n(0),
				c = n(6),
				d = n(8),
				f = n(9),
				h = n(4),
				p = 'TRTCClient',
				_ = (function() {
					function t(t) {
						(this._sdkAppID = t.sdkAppID),
							(this._userID = t.userID),
							(this._userSig = t.userSig),
							(this._trtcCalling = t.trtcCalling),
							(this._connectStartTime = 0),
							(this._isJoined = !1),
							(this._isPublished = !1),
							(this._localStream = null),
							(this._remoteStreams = []),
							(this._device = { video: null, audio: null }),
							(this._eventStatController = new f.default()),
							c.default.bindController(this._eventStatController);
						var e = s.VERSION;
						u.compareVersion(e, '4.7.0') >= 0
							? s.checkSystemRequirements().then(function(t) {
									t.result ||
										a.default.log(
											p +
												'.您的浏览器不兼容此应用！\n建议下载最新版Chrome浏览器'
										);
							  })
							: s.checkSystemRequirements().then(function(t) {
									t ||
										a.default.log(
											p +
												'.您的浏览器不兼容此应用！\n建议下载最新版Chrome浏览器'
										);
							  }),
							this.init();
					}
					return (
						(t.prototype.init = function() {
							(this._client = s.createClient({
								mode: 'rtc',
								sdkAppId: this._sdkAppID,
								userId: this._userID,
								userSig: this._userSig,
								frameWorkType: 32,
							})),
								this.handleEvents();
						}),
						(t.prototype.getRemoteStreams = function() {
							return this._remoteStreams;
						}),
						(t.prototype.getCamera = function() {
							return i(this, void 0, void 0, function() {
								var t,
									e = this;
								return r(this, function(n) {
									switch (n.label) {
										case 0:
											return [4, s.getCameras()];
										case 1:
											return (
												(t = n.sent()),
												a.default.log(
													p +
														'.getCamera - ' +
														JSON.stringify(t)
												),
												t.length > 0
													? (this._device.video &&
															t.some(function(t) {
																return (
																	t.deviceId ===
																	e._device
																		.video
																		.deviceId
																);
															})) ||
													  (this._device.video =
															t[0])
													: (this._device.video = null),
												[2, t]
											);
									}
								});
							});
						}),
						(t.prototype.getMicrophone = function() {
							return i(this, void 0, void 0, function() {
								var t,
									e = this;
								return r(this, function(n) {
									switch (n.label) {
										case 0:
											return [4, s.getMicrophones()];
										case 1:
											return (
												(t = n.sent()),
												a.default.log(
													p +
														'.getMicrophone - ' +
														JSON.stringify(t)
												),
												t.length > 0
													? (this._device.audio &&
															t.some(function(t) {
																return (
																	t.deviceId ===
																	e._device
																		.audio
																		.deviceId
																);
															})) ||
													  (this._device.audio =
															t[0])
													: (this._device.audio = null),
												[2, t]
											);
									}
								});
							});
						}),
						(t.prototype.switchDevice = function(t, e) {
							return i(this, void 0, void 0, function() {
								var n;
								return r(this, function(i) {
									return (
										a.default.log(
											p +
												'.switchDevice - params: deviceType:' +
												t +
												',deviceID:' +
												e
										),
										this._localStream
											? this._localStream.switchDevice(
													t,
													e
											  )
											: ((n = {
													deviceType: t,
													deviceId: e,
											  }),
											  (this._device[t] = n)),
										[2]
									);
								});
							});
						}),
						(t.prototype.join = function(t) {
							return i(this, void 0, void 0, function() {
								var e, n, i, o, u;
								return r(this, function(r) {
									switch (r.label) {
										case 0:
											return [4, this.getCamera()];
										case 1:
											return (
												r.sent(),
												[4, this.getMicrophone()]
											);
										case 2:
											if (
												(r.sent(),
												(e = this.getCallType()),
												!this._device.audio)
											)
												return (
													a.default.warn(
														p +
															'.join - invalid microphone'
													),
													this._trtcCalling._delegate.onError(
														h.default
															.NOT_MICROPHONE_LIST,
														'invalid microphone'
													),
													this._trtcCalling._resetTRTCClient(),
													[2]
												);
											if (
												!this._device.video &&
												e === l.CALL_TYPE.VIDEO_CALL
											)
												return (
													a.default.warn(
														p +
															'.join - invalid camera'
													),
													this._trtcCalling._delegate.onError(
														h.default
															.NOT_CAMERA_LIST,
														'invalid camera'
													),
													this._trtcCalling._resetTRTCClient(),
													[2]
												);
											if (this._isJoined)
												return (
													a.default.warn(
														p +
															'.join - duplicate RtcClient.join() observed'
													),
													[2]
												);
											r.label = 3;
										case 3:
											return (
												r.trys.push([3, 14, , 15]),
												[
													4,
													this._client.join({
														roomId: t,
													}),
												]
											);
										case 4:
											if (
												(r.sent(),
												(this._isJoined = !0),
												a.default.log(
													p +
														'.join - join room success, callType:' +
														e
												),
												e !== l.CALL_TYPE.AUDIO_CALL &&
													e !==
														l.CALL_TYPE.VIDEO_CALL)
											)
												return (
													a.default.log(
														p +
															'.join - invalid callType'
													),
													[2]
												);
											(n = {
												audio: !0,
												video: !1,
												userId: this._userID,
												microphoneId: this._device.audio
													.deviceId,
											}),
												e === l.CALL_TYPE.VIDEO_CALL &&
													((n.video = !0),
													(n.cameraId = this._device.video.deviceId)),
												(this._localStream = s.createStream(
													n
												)),
												this._localStream.setVideoProfile(
													this._trtcCalling.getVideoQuality()
												),
												(r.label = 5);
										case 5:
											return (
												r.trys.push([5, 8, , 13]),
												[
													4,
													this._localStream.initialize(),
												]
											);
										case 6:
											return (
												r.sent(),
												a.default.log(
													p +
														'.join - initialize local stream success'
												),
												this._localStream.on(
													'player-state-changed',
													function(t) {
														a.default.log(
															p +
																'.join - local stream ' +
																t.type +
																' player is ' +
																t.state
														);
													}
												),
												[4, this.publish()]
											);
										case 7:
											return (
												r.sent(),
												this._trtcCalling.changeCallStatus(
													l.CALL_STATUS.CONNECTED
												),
												(this._joinedTimestamp = new Date()),
												[3, 13]
											);
										case 8:
											(i = r.sent()),
												a.default.error(
													p +
														'.join - failed to initialize local stream - ' +
														i
												),
												(r.label = 9);
										case 9:
											return (
												r.trys.push([9, 11, , 12]),
												[
													4,
													navigator.mediaDevices.getUserMedia(
														{ audio: !0, video: !0 }
													),
												]
											);
										case 10:
											return r.sent(), [3, 12];
										case 11:
											return (
												(o = r.sent()),
												this._trtcCalling._delegate.onError(
													h.default.NOT_MEDIA_ACCESS,
													JSON.stringify(o)
												),
												[3, 12]
											);
										case 12:
											return [3, 13];
										case 13:
											return [3, 15];
										case 14:
											return (
												(u = r.sent()),
												a.default.error(
													p +
														'.join - join room failed! ' +
														u
												),
												[3, 15]
											);
										case 15:
											return [2];
									}
								});
							});
						}),
						(t.prototype.playVideo = function(t) {
							a.default.debug(p + '.playVideo - params:', t);
							var e = t.domID,
								n = t.type,
								i = t.userID;
							if (
								('local' === n && this._localStream.play(e),
								'remote' === n)
							) {
								var r = this._remoteStreams.find(function(t) {
									return t.getUserId() === i;
								});
								r && r.play(e);
							}
						}),
						(t.prototype.stopVideo = function(t) {
							a.default.debug(p + '.stopVideo - params:', t);
							var e = t.type,
								n = t.userID;
							if (
								('local' === e && this._localStream.stop(),
								'remote' === e)
							) {
								var i = this._remoteStreams.find(function(t) {
									return t.getUserId() === n;
								});
								i && i.stop();
							}
						}),
						(t.prototype.getCallType = function() {
							return this._trtcCalling.getCallType();
						}),
						(t.prototype.leave = function() {
							return i(this, void 0, void 0, function() {
								var t;
								return r(this, function(e) {
									switch (e.label) {
										case 0:
											return this._isJoined
												? [4, this.unpublish()]
												: (a.default.warn(
														p +
															'.leave - please join() firstly'
												  ),
												  [2]);
										case 1:
											return (
												e.sent(),
												[4, this._client.leave()]
											);
										case 2:
											return (
												e.sent(),
												this._localStream.stop(),
												this._localStream.close(),
												(this._localStream = null),
												(this._isJoined = !1),
												(this._leaveTimestamp = new Date()),
												(t = Math.floor(
													(this._leaveTimestamp -
														this._joinedTimestamp) /
														1e3
												)),
												new c.default(
													d.default.TALK_TIME
												)
													.setTalkTime(t)
													.setText('talkTime record')
													.setEnd(),
												[2]
											);
									}
								});
							});
						}),
						(t.prototype.publish = function() {
							return i(this, void 0, void 0, function() {
								var t;
								return r(this, function(e) {
									switch (e.label) {
										case 0:
											if (!this._isJoined)
												return (
													a.default.warn(
														p +
															'.publish - please join() firstly'
													),
													[2]
												);
											if (this._isPublished)
												return (
													a.default.warn(
														p +
															'.publish - duplicate RtcClient.publish() observed'
													),
													[2]
												);
											e.label = 1;
										case 1:
											return (
												e.trys.push([1, 3, , 4]),
												[
													4,
													this._client.publish(
														this._localStream
													),
												]
											);
										case 2:
											return e.sent(), [3, 4];
										case 3:
											return (
												(t = e.sent()),
												a.default.error(
													p +
														'.publish - failed to publish local stream ' +
														t
												),
												(this._isPublished = !1),
												[3, 4]
											);
										case 4:
											return (
												(this._isPublished = !0), [2]
											);
									}
								});
							});
						}),
						(t.prototype.unpublish = function() {
							return i(this, void 0, void 0, function() {
								return r(this, function(t) {
									switch (t.label) {
										case 0:
											return this._isJoined
												? this._isPublished
													? [
															4,
															this._client.unpublish(
																this
																	._localStream
															),
													  ]
													: (a.default.warn(
															p +
																'.unpublish - RtcClient.unpublish() called but not published yet'
													  ),
													  [2])
												: (a.default.warn(
														p +
															'.unpublish - please join() firstly'
												  ),
												  [2]);
										case 1:
											return (
												t.sent(),
												(this._isPublished = !1),
												[2]
											);
									}
								});
							});
						}),
						(t.prototype.handleEvents = function() {
							var t = this;
							this._client.on('error', function(e) {
								a.default.error(
									p + '.handleEvents - client on error ' + e
								);
								var n = e.getCode(),
									i = JSON.stringify({
										name: 'TRTC',
										error: e,
									});
								t._trtcCalling._delegate.onError(n, i);
							}),
								this._client.on('client-banned', function(t) {
									a.default.error(
										p +
											'.handleEvents - client has been banned for ' +
											t
									);
								}),
								this._client.on('peer-join', function(e) {
									var n = e.userId;
									if (
										(a.default.debug(
											p + '.handleEvents - peer-join ' + n
										),
										t._connectStartTime ||
											(t._connectStartTime = Date.now()),
										t._trtcCalling.isGroupCall())
									) {
										var i = t._trtcCalling.getUnHandledInviteeList(),
											r = o(i, [n]);
										t._trtcCalling.setUnHandledInviteeList(
											r
										),
											t._trtcCalling._delegate.onGroupCallInviteeListUpdate(
												r
											);
									}
								}),
								this._client.on('peer-leave', function(e) {
									return i(t, void 0, void 0, function() {
										var t, n, i, o, s;
										return r(this, function(r) {
											switch (r.label) {
												case 0:
													return (
														(t = e.userId),
														(n = this._remoteStreams.filter(
															function(e) {
																return (
																	e.getUserId() !==
																	t
																);
															}
														)),
														(i = this._trtcCalling.getUnHandledInviteeList()),
														(o = this._trtcCalling.isGroupCall()),
														a.default.log(
															p +
																'.handleEvents - peer-leave isGroupCall:' +
																o +
																' userID:' +
																t +
																',\n       remainStreamsCount:' +
																n.length +
																' unHandledListLength:' +
																i.length
														),
														o &&
															0 !== i.length &&
															((s = i.filter(
																function(e) {
																	return (
																		e !== t
																	);
																}
															)),
															this._trtcCalling.setUnHandledInviteeList(
																s
															),
															this._trtcCalling._delegate.onGroupCallInviteeListUpdate(
																s
															)),
														0 !== n.length
															? [3, 3]
															: [4, this.leave()]
													);
												case 1:
													return (
														r.sent(),
														[
															4,
															this._trtcCalling._tsignalingClient.lastOneHangup(
																{
																	userIDList: [
																		t,
																	],
																	callType: this.getCallType(),
																	callEnd: Math.round(
																		(Date.now() -
																			this
																				._connectStartTime) /
																			1e3
																	),
																}
															),
														]
													);
												case 2:
													r.sent(),
														this._trtcCalling._resetTRTCClient(),
														(this._connectStartTime = 0),
														(r.label = 3);
												case 3:
													return [2];
											}
										});
									});
								}),
								this._client.on('stream-added', function(e) {
									var n = e.stream,
										i = n.getId(),
										r = n.getUserId();
									a.default.debug(
										p +
											'.handleEvents - remote stream added, userID:' +
											r +
											' streamID:' +
											i +
											' type:' +
											n.getType()
									),
										t._client.subscribe(n);
								}),
								this._client.on('stream-subscribed', function(
									e
								) {
									return i(t, void 0, void 0, function() {
										var t, n, i, o, s, u, c;
										return r(this, function(r) {
											return (
												(t = e.stream),
												this._remoteStreams.push(t),
												(n = t.getUserId()),
												this._trtcCalling._delegate.onUserEnter(
													n
												),
												(i =
													'_trtc_calling_audio_call-' +
													n),
												this.getCallType() ===
													l.CALL_TYPE.AUDIO_CALL &&
													((o = document.getElementById(
														'_trtc_calling_layer'
													)) ||
														((o = document.createElement(
															'div'
														)).setAttribute(
															'id',
															'_trtc_calling_layer'
														),
														(o.style.display =
															'none'),
														document.body.appendChild(
															o
														)),
													(s = document.createElement(
														'div'
													)).setAttribute('id', i),
													o.appendChild(s),
													((u = document.createElement(
														'button'
													)).onclick = function() {
														a.default.log(
															p +
																'.remoteStream - resume'
														),
															t.resume();
													}),
													u.setAttribute(
														'class',
														'resume'
													),
													(u.style.display = 'none'),
													document.body.appendChild(
														u
													),
													t.play(i),
													(c = setTimeout(function() {
														u.click(),
															clearTimeout(c),
															document.body.removeChild(
																u
															);
													}, 0))),
												[2]
											);
										});
									});
								}),
								this._client.on('stream-removed', function(e) {
									var n = e.stream,
										i = n.getId(),
										r = n.getUserId(),
										o = '_trtc_calling_audio_call-' + r;
									if (
										(n.stop(),
										n.close(),
										(t._remoteStreams = t._remoteStreams.filter(
											function(t) {
												return t.getId() !== i;
											}
										)),
										t._trtcCalling._delegate.onUserLeave(r),
										t.getCallType() ===
											l.CALL_TYPE.AUDIO_CALL)
									) {
										var s = document.getElementById(
												'_trtc_calling_layer'
											),
											u = document.getElementById(o);
										s && u && s.removeChild(u);
									}
									a.default.debug(
										p +
											'.handleEvents - remote stream-removed, streamID:' +
											i +
											' type:' +
											n.getType()
									);
								}),
								this._client.on('stream-updated', function(t) {
									var e = t.stream,
										n = e.getType(),
										i = e.hasAudio(),
										r = e.hasVideo();
									a.default.debug(
										p +
											'.handleEvents - stream-updated, type:' +
											n +
											' hasAudio:' +
											i +
											' hasVideo:' +
											r
									);
								}),
								this._client.on('mute-audio', function(e) {
									a.default.debug(
										p +
											'.handleEvents - ' +
											e.userId +
											' mute audio'
									),
										t._trtcCalling._delegate.onUserAudioAvailable(
											{
												userID: e.userId,
												isAudioAvailable: !1,
											}
										);
								}),
								this._client.on('unmute-audio', function(e) {
									a.default.debug(
										p +
											'.handleEvents - ' +
											e.userId +
											' unmute audio'
									),
										t._trtcCalling._delegate.onUserAudioAvailable(
											{
												userID: e.userId,
												isAudioAvailable: !0,
											}
										);
								}),
								this._client.on('mute-video', function(e) {
									a.default.debug(
										p +
											'.handleEvents - ' +
											e.userId +
											' mute video'
									),
										t._trtcCalling._delegate.onUserVideoAvailable(
											{
												userID: e.userId,
												isVideoAvailable: !1,
											}
										);
								}),
								this._client.on('unmute-video', function(e) {
									a.default.debug(
										p +
											'.handleEvents - ' +
											e.userId +
											' unmute video'
									),
										t._trtcCalling._delegate.onUserVideoAvailable(
											{
												userID: e.userId,
												isVideoAvailable: !0,
											}
										);
								}),
								this._client.on(
									'connection-state-changed',
									function(t) {
										a.default.debug(
											p +
												'.handleEvents - RtcClient state changed from ' +
												t.prevState +
												' to ' +
												t.state
										);
									}
								);
						}),
						(t.prototype.muteLocalVideo = function() {
							this._localStream.muteVideo();
						}),
						(t.prototype.unMuteLocalVideo = function() {
							this._localStream.unmuteVideo();
						}),
						(t.prototype.muteLocalAudio = function() {
							this._localStream.muteAudio();
						}),
						(t.prototype.unMuteLocalAudio = function() {
							this._localStream.unmuteAudio();
						}),
						(t.prototype.switchCallMode = function(t) {
							a.default.log(p + '.switchCallMode - type', t);
							var e = this._localStream.getVideoTrack();
							switch (t) {
								case l.CALL_TYPE.VIDEO_CALL:
									this.removeTrack(e),
										this._trtcCalling.setSwitchCallModeStatus(
											!0
										);
									break;
								case l.CALL_TYPE.AUDIO_CALL:
									this.addTrack(e),
										this._trtcCalling.setSwitchCallModeStatus(
											!0
										);
							}
						}),
						(t.prototype.removeTrack = function(t) {
							return i(this, void 0, void 0, function() {
								var e;
								return r(this, function(n) {
									switch (n.label) {
										case 0:
											if (
												(a.default.log(
													p + '.removeTrack ',
													!!t
												),
												!t)
											)
												return [3, 4];
											n.label = 1;
										case 1:
											return (
												n.trys.push([1, 3, , 4]),
												[
													4,
													this._localStream.removeTrack(
														t
													),
												]
											);
										case 2:
											return (
												n.sent(),
												t.stop(),
												this._trtcCalling.setCallType(
													l.CALL_TYPE.AUDIO_CALL
												),
												[3, 4]
											);
										case 3:
											return (
												(e = n.sent()),
												a.default.error(
													p +
														'.removeTrack - failed to removeTrack local stream ' +
														e
												),
												this._trtcCalling._delegate.onError(
													h.default
														.FAILURE_SWITCH_TO_AUDIO,
													"switch to audio call error'"
												),
												[3, 4]
											);
										case 4:
											return [2];
									}
								});
							});
						}),
						(t.prototype.addTrack = function(t) {
							return i(this, void 0, void 0, function() {
								var e, n, i;
								return r(this, function(r) {
									switch (r.label) {
										case 0:
											return (
												a.default.log(
													p + '.addTrack ',
													!t
												),
												t
													? [3, 6]
													: [
															4,
															(e = s.createStream(
																{
																	userId: this._trtcCalling.getUserID(),
																	audio: !1,
																	video: !0,
																}
															)).setVideoProfile(
																this._trtcCalling.getVideoQuality()
															),
													  ]
											);
										case 1:
											return (
												r.sent(), [4, e.initialize()]
											);
										case 2:
											r.sent(),
												(n = e.getVideoTrack()),
												(r.label = 3);
										case 3:
											return (
												r.trys.push([3, 5, , 6]),
												[
													4,
													this._localStream.addTrack(
														n
													),
												]
											);
										case 4:
											return (
												r.sent(),
												this._trtcCalling.setCallType(
													l.CALL_TYPE.VIDEO_CALL
												),
												[3, 6]
											);
										case 5:
											return (
												(i = r.sent()),
												a.default.error(
													p +
														'.addTrack - failed to addTrack local stream ' +
														i
												),
												this._trtcCalling._delegate.onError(
													h.default
														.FAILURE_SWITCH_TO_VIDEO,
													"switch to video call error'"
												),
												[3, 6]
											);
										case 6:
											return [2];
									}
								});
							});
						}),
						t
					);
				})();
			e.default = _;
		},
		function(t, e) {
			var n;
			n = (function() {
				return this;
			})();
			try {
				n = n || new Function('return this')();
			} catch (t) {
				'object' == typeof window && (n = window);
			}
			t.exports = n;
		},
		function(t, e, n) {
			'use strict';
			var i = n(2),
				r = n(12),
				o = n(28),
				s = n(18);
			function a(t) {
				var e = new o(t),
					n = r(o.prototype.request, e);
				return i.extend(n, o.prototype, e), i.extend(n, e), n;
			}
			var l = a(n(15));
			(l.Axios = o),
				(l.create = function(t) {
					return a(s(l.defaults, t));
				}),
				(l.Cancel = n(19)),
				(l.CancelToken = n(42)),
				(l.isCancel = n(14)),
				(l.all = function(t) {
					return Promise.all(t);
				}),
				(l.spread = n(43)),
				(l.isAxiosError = n(44)),
				(t.exports = l),
				(t.exports.default = l);
		},
		function(t, e, n) {
			'use strict';
			var i = n(2),
				r = n(13),
				o = n(29),
				s = n(30),
				a = n(18);
			function l(t) {
				(this.defaults = t),
					(this.interceptors = {
						request: new o(),
						response: new o(),
					});
			}
			(l.prototype.request = function(t) {
				'string' == typeof t
					? ((t = arguments[1] || {}).url = arguments[0])
					: (t = t || {}),
					(t = a(this.defaults, t)).method
						? (t.method = t.method.toLowerCase())
						: this.defaults.method
						? (t.method = this.defaults.method.toLowerCase())
						: (t.method = 'get');
				var e = [s, void 0],
					n = Promise.resolve(t);
				for (
					this.interceptors.request.forEach(function(t) {
						e.unshift(t.fulfilled, t.rejected);
					}),
						this.interceptors.response.forEach(function(t) {
							e.push(t.fulfilled, t.rejected);
						});
					e.length;

				)
					n = n.then(e.shift(), e.shift());
				return n;
			}),
				(l.prototype.getUri = function(t) {
					return (
						(t = a(this.defaults, t)),
						r(t.url, t.params, t.paramsSerializer).replace(
							/^\?/,
							''
						)
					);
				}),
				i.forEach(['delete', 'get', 'head', 'options'], function(t) {
					l.prototype[t] = function(e, n) {
						return this.request(
							a(n || {}, {
								method: t,
								url: e,
								data: (n || {}).data,
							})
						);
					};
				}),
				i.forEach(['post', 'put', 'patch'], function(t) {
					l.prototype[t] = function(e, n, i) {
						return this.request(
							a(i || {}, { method: t, url: e, data: n })
						);
					};
				}),
				(t.exports = l);
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			function r() {
				this.handlers = [];
			}
			(r.prototype.use = function(t, e) {
				return (
					this.handlers.push({ fulfilled: t, rejected: e }),
					this.handlers.length - 1
				);
			}),
				(r.prototype.eject = function(t) {
					this.handlers[t] && (this.handlers[t] = null);
				}),
				(r.prototype.forEach = function(t) {
					i.forEach(this.handlers, function(e) {
						null !== e && t(e);
					});
				}),
				(t.exports = r);
		},
		function(t, e, n) {
			'use strict';
			var i = n(2),
				r = n(31),
				o = n(14),
				s = n(15);
			function a(t) {
				t.cancelToken && t.cancelToken.throwIfRequested();
			}
			t.exports = function(t) {
				return (
					a(t),
					(t.headers = t.headers || {}),
					(t.data = r(t.data, t.headers, t.transformRequest)),
					(t.headers = i.merge(
						t.headers.common || {},
						t.headers[t.method] || {},
						t.headers
					)),
					i.forEach(
						[
							'delete',
							'get',
							'head',
							'post',
							'put',
							'patch',
							'common',
						],
						function(e) {
							delete t.headers[e];
						}
					),
					(t.adapter || s.adapter)(t).then(
						function(e) {
							return (
								a(t),
								(e.data = r(
									e.data,
									e.headers,
									t.transformResponse
								)),
								e
							);
						},
						function(e) {
							return (
								o(e) ||
									(a(t),
									e &&
										e.response &&
										(e.response.data = r(
											e.response.data,
											e.response.headers,
											t.transformResponse
										))),
								Promise.reject(e)
							);
						}
					)
				);
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			t.exports = function(t, e, n) {
				return (
					i.forEach(n, function(n) {
						t = n(t, e);
					}),
					t
				);
			};
		},
		function(t, e) {
			var n,
				i,
				r = (t.exports = {});
			function o() {
				throw new Error('setTimeout has not been defined');
			}
			function s() {
				throw new Error('clearTimeout has not been defined');
			}
			function a(t) {
				if (n === setTimeout) return setTimeout(t, 0);
				if ((n === o || !n) && setTimeout)
					return (n = setTimeout), setTimeout(t, 0);
				try {
					return n(t, 0);
				} catch (e) {
					try {
						return n.call(null, t, 0);
					} catch (e) {
						return n.call(this, t, 0);
					}
				}
			}
			!(function() {
				try {
					n = 'function' == typeof setTimeout ? setTimeout : o;
				} catch (t) {
					n = o;
				}
				try {
					i = 'function' == typeof clearTimeout ? clearTimeout : s;
				} catch (t) {
					i = s;
				}
			})();
			var l,
				u = [],
				c = !1,
				d = -1;
			function f() {
				c &&
					l &&
					((c = !1),
					l.length ? (u = l.concat(u)) : (d = -1),
					u.length && h());
			}
			function h() {
				if (!c) {
					var t = a(f);
					c = !0;
					for (var e = u.length; e; ) {
						for (l = u, u = []; ++d < e; ) l && l[d].run();
						(d = -1), (e = u.length);
					}
					(l = null),
						(c = !1),
						(function(t) {
							if (i === clearTimeout) return clearTimeout(t);
							if ((i === s || !i) && clearTimeout)
								return (i = clearTimeout), clearTimeout(t);
							try {
								i(t);
							} catch (e) {
								try {
									return i.call(null, t);
								} catch (e) {
									return i.call(this, t);
								}
							}
						})(t);
				}
			}
			function p(t, e) {
				(this.fun = t), (this.array = e);
			}
			function _() {}
			(r.nextTick = function(t) {
				var e = new Array(arguments.length - 1);
				if (arguments.length > 1)
					for (var n = 1; n < arguments.length; n++)
						e[n - 1] = arguments[n];
				u.push(new p(t, e)), 1 !== u.length || c || a(h);
			}),
				(p.prototype.run = function() {
					this.fun.apply(null, this.array);
				}),
				(r.title = 'browser'),
				(r.browser = !0),
				(r.env = {}),
				(r.argv = []),
				(r.version = ''),
				(r.versions = {}),
				(r.on = _),
				(r.addListener = _),
				(r.once = _),
				(r.off = _),
				(r.removeListener = _),
				(r.removeAllListeners = _),
				(r.emit = _),
				(r.prependListener = _),
				(r.prependOnceListener = _),
				(r.listeners = function(t) {
					return [];
				}),
				(r.binding = function(t) {
					throw new Error('process.binding is not supported');
				}),
				(r.cwd = function() {
					return '/';
				}),
				(r.chdir = function(t) {
					throw new Error('process.chdir is not supported');
				}),
				(r.umask = function() {
					return 0;
				});
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			t.exports = function(t, e) {
				i.forEach(t, function(n, i) {
					i !== e &&
						i.toUpperCase() === e.toUpperCase() &&
						((t[e] = n), delete t[i]);
				});
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(17);
			t.exports = function(t, e, n) {
				var r = n.config.validateStatus;
				n.status && r && !r(n.status)
					? e(
							i(
								'Request failed with status code ' + n.status,
								n.config,
								null,
								n.request,
								n
							)
					  )
					: t(n);
			};
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t, e, n, i, r) {
				return (
					(t.config = e),
					n && (t.code = n),
					(t.request = i),
					(t.response = r),
					(t.isAxiosError = !0),
					(t.toJSON = function() {
						return {
							message: this.message,
							name: this.name,
							description: this.description,
							number: this.number,
							fileName: this.fileName,
							lineNumber: this.lineNumber,
							columnNumber: this.columnNumber,
							stack: this.stack,
							config: this.config,
							code: this.code,
						};
					}),
					t
				);
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			t.exports = i.isStandardBrowserEnv()
				? {
						write: function(t, e, n, r, o, s) {
							var a = [];
							a.push(t + '=' + encodeURIComponent(e)),
								i.isNumber(n) &&
									a.push(
										'expires=' + new Date(n).toGMTString()
									),
								i.isString(r) && a.push('path=' + r),
								i.isString(o) && a.push('domain=' + o),
								!0 === s && a.push('secure'),
								(document.cookie = a.join('; '));
						},
						read: function(t) {
							var e = document.cookie.match(
								new RegExp('(^|;\\s*)(' + t + ')=([^;]*)')
							);
							return e ? decodeURIComponent(e[3]) : null;
						},
						remove: function(t) {
							this.write(t, '', Date.now() - 864e5);
						},
				  }
				: {
						write: function() {},
						read: function() {
							return null;
						},
						remove: function() {},
				  };
		},
		function(t, e, n) {
			'use strict';
			var i = n(38),
				r = n(39);
			t.exports = function(t, e) {
				return t && !i(e) ? r(t, e) : e;
			};
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t) {
				return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t);
			};
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t, e) {
				return e
					? t.replace(/\/+$/, '') + '/' + e.replace(/^\/+/, '')
					: t;
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2),
				r = [
					'age',
					'authorization',
					'content-length',
					'content-type',
					'etag',
					'expires',
					'from',
					'host',
					'if-modified-since',
					'if-unmodified-since',
					'last-modified',
					'location',
					'max-forwards',
					'proxy-authorization',
					'referer',
					'retry-after',
					'user-agent',
				];
			t.exports = function(t) {
				var e,
					n,
					o,
					s = {};
				return t
					? (i.forEach(t.split('\n'), function(t) {
							if (
								((o = t.indexOf(':')),
								(e = i.trim(t.substr(0, o)).toLowerCase()),
								(n = i.trim(t.substr(o + 1))),
								e)
							) {
								if (s[e] && r.indexOf(e) >= 0) return;
								s[e] =
									'set-cookie' === e
										? (s[e] ? s[e] : []).concat([n])
										: s[e]
										? s[e] + ', ' + n
										: n;
							}
					  }),
					  s)
					: s;
			};
		},
		function(t, e, n) {
			'use strict';
			var i = n(2);
			t.exports = i.isStandardBrowserEnv()
				? (function() {
						var t,
							e = /(msie|trident)/i.test(navigator.userAgent),
							n = document.createElement('a');
						function r(t) {
							var i = t;
							return (
								e && (n.setAttribute('href', i), (i = n.href)),
								n.setAttribute('href', i),
								{
									href: n.href,
									protocol: n.protocol
										? n.protocol.replace(/:$/, '')
										: '',
									host: n.host,
									search: n.search
										? n.search.replace(/^\?/, '')
										: '',
									hash: n.hash
										? n.hash.replace(/^#/, '')
										: '',
									hostname: n.hostname,
									port: n.port,
									pathname:
										'/' === n.pathname.charAt(0)
											? n.pathname
											: '/' + n.pathname,
								}
							);
						}
						return (
							(t = r(window.location.href)),
							function(e) {
								var n = i.isString(e) ? r(e) : e;
								return (
									n.protocol === t.protocol &&
									n.host === t.host
								);
							}
						);
				  })()
				: function() {
						return !0;
				  };
		},
		function(t, e, n) {
			'use strict';
			var i = n(19);
			function r(t) {
				if ('function' != typeof t)
					throw new TypeError('executor must be a function.');
				var e;
				this.promise = new Promise(function(t) {
					e = t;
				});
				var n = this;
				t(function(t) {
					n.reason || ((n.reason = new i(t)), e(n.reason));
				});
			}
			(r.prototype.throwIfRequested = function() {
				if (this.reason) throw this.reason;
			}),
				(r.source = function() {
					var t;
					return {
						token: new r(function(e) {
							t = e;
						}),
						cancel: t,
					};
				}),
				(t.exports = r);
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t) {
				return function(e) {
					return t.apply(null, e);
				};
			};
		},
		function(t, e, n) {
			'use strict';
			t.exports = function(t) {
				return 'object' == typeof t && !0 === t.isAxiosError;
			};
		},
		function(t, n) {
			t.exports = e;
		},
		function(t, e, n) {
			'use strict';
			var i =
					(this && this.__assign) ||
					function() {
						return (i =
							Object.assign ||
							function(t) {
								for (
									var e, n = 1, i = arguments.length;
									n < i;
									n++
								)
									for (var r in (e = arguments[n]))
										Object.prototype.hasOwnProperty.call(
											e,
											r
										) && (t[r] = e[r]);
								return t;
							}).apply(this, arguments);
					},
				r =
					(this && this.__awaiter) ||
					function(t, e, n, i) {
						return new (n || (n = Promise))(function(r, o) {
							function s(t) {
								try {
									l(i.next(t));
								} catch (t) {
									o(t);
								}
							}
							function a(t) {
								try {
									l(i.throw(t));
								} catch (t) {
									o(t);
								}
							}
							function l(t) {
								var e;
								t.done
									? r(t.value)
									: ((e = t.value),
									  e instanceof n
											? e
											: new n(function(t) {
													t(e);
											  })).then(s, a);
							}
							l((i = i.apply(t, e || [])).next());
						});
					},
				o =
					(this && this.__generator) ||
					function(t, e) {
						var n,
							i,
							r,
							o,
							s = {
								label: 0,
								sent: function() {
									if (1 & r[0]) throw r[1];
									return r[1];
								},
								trys: [],
								ops: [],
							};
						return (
							(o = { next: a(0), throw: a(1), return: a(2) }),
							'function' == typeof Symbol &&
								(o[Symbol.iterator] = function() {
									return this;
								}),
							o
						);
						function a(o) {
							return function(a) {
								return (function(o) {
									if (n)
										throw new TypeError(
											'Generator is already executing.'
										);
									for (; s; )
										try {
											if (
												((n = 1),
												i &&
													(r =
														2 & o[0]
															? i.return
															: o[0]
															? i.throw ||
															  ((r = i.return) &&
																	r.call(i),
															  0)
															: i.next) &&
													!(r = r.call(i, o[1])).done)
											)
												return r;
											switch (
												((i = 0),
												r && (o = [2 & o[0], r.value]),
												o[0])
											) {
												case 0:
												case 1:
													r = o;
													break;
												case 4:
													return (
														s.label++,
														{
															value: o[1],
															done: !1,
														}
													);
												case 5:
													s.label++,
														(i = o[1]),
														(o = [0]);
													continue;
												case 7:
													(o = s.ops.pop()),
														s.trys.pop();
													continue;
												default:
													if (
														!((r = s.trys),
														(r =
															r.length > 0 &&
															r[r.length - 1]) ||
															(6 !== o[0] &&
																2 !== o[0]))
													) {
														s = 0;
														continue;
													}
													if (
														3 === o[0] &&
														(!r ||
															(o[1] > r[0] &&
																o[1] < r[3]))
													) {
														s.label = o[1];
														break;
													}
													if (
														6 === o[0] &&
														s.label < r[1]
													) {
														(s.label = r[1]),
															(r = o);
														break;
													}
													if (r && s.label < r[2]) {
														(s.label = r[2]),
															s.ops.push(o);
														break;
													}
													r[2] && s.ops.pop(),
														s.trys.pop();
													continue;
											}
											o = e.call(t, s);
										} catch (t) {
											(o = [6, t]), (i = 0);
										} finally {
											n = r = 0;
										}
									if (5 & o[0]) throw o[1];
									return {
										value: o[0] ? o[1] : void 0,
										done: !0,
									};
								})([o, a]);
							};
						}
					},
				s =
					(this && this.__rest) ||
					function(t, e) {
						var n = {};
						for (var i in t)
							Object.prototype.hasOwnProperty.call(t, i) &&
								e.indexOf(i) < 0 &&
								(n[i] = t[i]);
						if (
							null != t &&
							'function' == typeof Object.getOwnPropertySymbols
						) {
							var r = 0;
							for (
								i = Object.getOwnPropertySymbols(t);
								r < i.length;
								r++
							)
								e.indexOf(i[r]) < 0 &&
									Object.prototype.propertyIsEnumerable.call(
										t,
										i[r]
									) &&
									(n[i[r]] = t[i[r]]);
						}
						return n;
					};
			Object.defineProperty(e, '__esModule', { value: !0 });
			var a = n(47),
				l = n(1),
				u = n(7),
				c = n(0),
				d = n(4),
				f = 'TSignalClient',
				h = (function() {
					function t(t, e) {
						(this._trtcCalling = t),
							(this._tsignaling = new a(e)),
							(this._tsignalingReady = !1),
							(this._joined = !1),
							(this._newInvitationData = null),
							this.initEvents();
					}
					return (
						(t.prototype.setLogLevel = function(t) {
							this._tsignaling.setLogLevel(t);
						}),
						(t.prototype.initEvents = function() {
							var t = this._tsignaling;
							t.on(a.EVENT.SDK_READY, this.onSdkReady, this),
								t.on(
									a.EVENT.SDK_NOT_READY,
									this.onSdkNotReady,
									this
								),
								t.on(
									a.EVENT.NEW_INVITATION_RECEIVED,
									this.onNewInvitationReceived,
									this
								),
								t.on(
									a.EVENT.INVITEE_ACCEPTED,
									this.onInviteeAccepted,
									this
								),
								t.on(
									a.EVENT.INVITEE_REJECTED,
									this.onInviteeRejected,
									this
								),
								t.on(
									a.EVENT.INVITATION_CANCELLED,
									this.onInvitationCancelled,
									this
								),
								t.on(
									a.EVENT.INVITATION_TIMEOUT,
									this.onInvitationTimeout,
									this
								),
								t.on(
									a.EVENT.KICKED_OUT,
									this.onKickedOut,
									this
								),
								t.on(
									a.EVENT.NET_STATE_CHANGE,
									this.onNetStateChange,
									this
								);
						}),
						(t.prototype.onSdkReady = function(t) {
							(this._tsignalingReady = !0),
								this._trtcCalling._delegate.onSdkReady(t);
						}),
						(t.prototype.onSdkNotReady = function(t) {
							this._tsignalingReady = !1;
						}),
						(t.prototype.onNewInvitationReceived = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r, s, a, h, p, _, g, I;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											if (
												((e = this._trtcCalling.getCallStatus()),
												l.default.debug(
													f +
														'.onNewInvitationReceived - params:',
													t,
													'currentCallStatus:' + e
												),
												(n = t.data),
												(i = n.inviter),
												(r = n.inviteeList),
												(s = n.data),
												(a = n.inviteID),
												(h = n.groupID),
												(p = JSON.parse(s)),
												!h &&
													this._isOnACall() &&
													this.judgeSwitchCallMode(p))
											)
												return (
													this.handleSwitchCallMode(
														a,
														p
													),
													[2]
												);
											if (
												this._isOnACall() ||
												e === u.CALL_STATUS.CALLING
											)
												return (
													this.reject({
														inviteID: a,
														callType: p.call_type,
														isBusy: !0,
													}),
													this._trtcCalling.setSwitchCallModeStatus(
														!0
													),
													this._trtcCalling._delegate.onLineBusy(
														i,
														this._trtcCalling.getUserID()
													),
													[2]
												);
											if (
												(_ = !!(
													h ||
													r.length >= 2 ||
													p.data
												))
											) {
												if (
													!p.room_id ||
													0 === p.call_end
												)
													return (
														this._trtcCalling._delegate.onCallEnd(
															i,
															p.call_end || 0
														),
														[2]
													);
											} else if (c.isNumber(p.call_end) && p.call_end > 0) return this._trtcCalling._delegate.onCallEnd(i, p.call_end), [2];
											this._trtcCalling.setInviterID(i),
												_ &&
													(this._trtcCalling.setIsGroupCall(
														_
													),
													this._trtcCalling.setInviteeList(
														r
													),
													this._trtcCalling.setUnHandledInviteeList(
														r
													),
													this._trtcCalling.setGroupID(
														h
													)),
												this._trtcCalling.changeCallStatus(
													u.CALL_STATUS.CALLING
												),
												(this._newInvitationData = {
													sponsor: i,
													userIDList: r,
													isFromGroup: _,
													inviteID: a,
													inviteData: {
														version: p.version,
														callType: p.call_type,
														callEnd: 0,
														roomID: p.room_id,
													},
												}),
												(o.label = 1);
										case 1:
											return (
												o.trys.push([1, 3, , 4]),
												[
													4,
													navigator.mediaDevices.getUserMedia(
														{
															audio: !0,
															video:
																p.call_type ===
																u.CALL_TYPE
																	.VIDEO_CALL,
														}
													),
												]
											);
										case 2:
											return (
												(g = o.sent()),
												l.default.log(
													'getUserMedia info',
													JSON.stringify(g)
												),
												this._trtcCalling._delegate.onInvited(
													this._newInvitationData
												),
												[3, 4]
											);
										case 3:
											return (
												(I = o.sent()),
												this._trtcCalling._delegate.onError(
													d.default.NOT_MEDIA_ACCESS,
													JSON.stringify(I)
												),
												l.default.error(
													'onNewInvitationReceived getUserMedia failure ' +
														JSON.stringify(I) +
														'. reject remote invite'
												),
												this._trtcCalling.reject(),
												[3, 4]
											);
										case 4:
											return [2];
									}
								});
							});
						}),
						(t.prototype.getInviteData = function() {
							return this._newInvitationData;
						}),
						(t.prototype.setInviteData = function(t) {
							this._newInvitationData = t;
						}),
						(t.prototype.handleSwitchCallMode = function(t, e) {
							var n = { inviteID: t, callType: e.call_type },
								i = { cmd: 'switchToVideo' };
							e.call_type === u.CALL_TYPE.VIDEO_CALL &&
								((n.switch_to_audio_call =
									'switch_to_audio_call'),
								(i.cmd = 'switchToAudio')),
								this.accept(n, i),
								this._trtcCalling.setSwitchCallModeStatus(!1),
								this._trtcCalling._trtcClient.switchCallMode(
									this._trtcCalling.getCallType()
								);
						}),
						(t.prototype.judgeSwitchCallMode = function(t) {
							return (
								(t.switch_to_audio_call &&
									'switch_to_audio_call' ===
										t.switch_to_audio_call) ||
								'switchToAudio' === t.data.cmd ||
								'switchToVideo' === t.data.cmd
							);
						}),
						(t.prototype.onInviteeAccepted = function(t) {
							l.default.log(
								f + '.onInviteeAccepted - params:',
								t
							);
							var e = JSON.parse(t.data.data);
							if (
								this._trtcCalling.isGroupCall() ||
								!this._isOnACall() ||
								!this.judgeSwitchCallMode(e) ||
								this._trtcCalling.getSwitchCallModeStatus()
							) {
								this._trtcCalling._delegate.onUserAccept(
									this._trtcCalling.getUserID()
								),
									this._trtcCalling.delInviterInviteID(
										t.data.inviteID
									);
								var n = t.data.invitee;
								if (this._trtcCalling.isGroupCall()) {
									var i = this._trtcCalling
										.getUnHandledInviteeList()
										.filter(function(t) {
											return t !== n;
										});
									this._trtcCalling.setUnHandledInviteeList(
										i
									);
								}
								if (
									n === this._trtcCalling.getUserID() &&
									this._trtcCalling.getCallStatus() ===
										u.CALL_STATUS.CALLING
								)
									return (
										this._trtcCalling._resetTRTCClient(),
										void this._trtcCalling._delegate.onReject(
											this._trtcCalling.getInviterID()
										)
									);
								this._trtcCalling.isInviter() &&
									!this._joined &&
									(this._trtcCalling._trtcClient.join(
										this._trtcCalling._roomID
									),
									(this._joined = !0));
							} else
								this._trtcCalling._trtcClient.switchCallMode(
									this._trtcCalling.getCallType()
								);
						}),
						(t.prototype.onInviteeRejected = function(t) {
							if (
								!this._trtcCalling.isGroupCall() &&
								!this._trtcCalling.getSwitchCallModeStatus()
							)
								return (
									l.default.log(
										f +
											'.onInviteeRejected - Audio and video switching is not available'
									),
									void this._trtcCalling.setSwitchCallModeStatus(
										!0
									)
								);
							l.default.log(
								f + '.onInviteeRejected - params:',
								t
							);
							var e = t.data.invitee,
								n = t.data.inviter,
								i = t.data.inviteID,
								r = JSON.parse(t.data.data);
							if (
								('line_busy' === r.line_busy ||
								'' === r.line_busy ||
								(r.data &&
									r.data.message &&
									'lineBusy' === r.data.message)
									? this._trtcCalling._delegate.onLineBusy(
											n,
											e
									  )
									: this._trtcCalling._delegate.onReject(e),
								this._trtcCalling.delInviterInviteID(i),
								this._trtcCalling.isGroupCall())
							) {
								var o = this._trtcCalling.getUnHandledInviteeList();
								(o = o.filter(function(t) {
									return t !== e;
								})),
									this._trtcCalling.setUnHandledInviteeList(
										o
									),
									0 === o.length &&
										(this._trtcCalling.getCallStatus() ===
											u.CALL_STATUS.CALLING &&
											this._trtcCalling._resetTRTCClient(),
										this._trtcCalling.getCallStatus() ===
											u.CALL_STATUS.CONNECTED &&
											(this._trtcCalling.hasRemoteConnectedUsers() ||
												this._trtcCalling._delegate.onCallEnd(
													e,
													0
												)));
							} else this._trtcCalling._resetTRTCClient();
						}),
						(t.prototype.onInvitationCancelled = function(t) {
							l.default.debug(
								f + '.onInvitationCancelled - params:',
								t
							),
								this._trtcCalling._delegate.onCallingCancel(),
								this._trtcCalling._resetTRTCClient();
						}),
						(t.prototype.onInvitationTimeout = function(t) {
							var e = t.data,
								n = e.inviter,
								i = e.inviteeList,
								r = e.isSelfTimeout,
								o = this._trtcCalling.getUserID(),
								s = this._trtcCalling.isGroupCall(),
								a = n === o,
								c = this._isOnACall(),
								d = this._trtcCalling.getRemoteStreamCount();
							if (
								(l.default.log(
									f + '.onInvitationTimeout - params:',
									t,
									'currentUserID:' +
										o +
										' isInviter:' +
										a +
										' isGroupCall:' +
										s +
										' isOnACall:' +
										c +
										' remoteStreamCount:' +
										d
								),
								!c && r && a)
							)
								return (
									this._trtcCalling._delegate.onNoResp(n, i),
									this._trtcCalling.hangup(),
									void this._trtcCalling._delegate.onCallEnd(
										n,
										0
									)
								);
							if (
								(this._trtcCalling.delInviterInviteID(
									t.data.inviteID
								),
								this._trtcCalling._delegate.onCallingTimeout(
									n,
									i
								),
								s)
							) {
								var h = this._trtcCalling.getUnHandledInviteeList(),
									p = [];
								h.forEach(function(t) {
									-1 === i.indexOf(t) && p.push(t);
								}),
									this._trtcCalling.setUnHandledInviteeList(
										p
									),
									0 === d &&
										0 === p.length &&
										(c
											? (this._trtcCalling.hangup(),
											  this.lastOneHangup({
													userIDList: [n],
													callType: this._trtcCalling.getCallType(),
													callEnd: 0,
											  }))
											: (this._trtcCalling._delegate.onCallEnd(
													n,
													0
											  ),
											  this._trtcCalling.changeCallStatus(
													u.CALL_STATUS.IDLE
											  )));
							} else
								this._trtcCalling._delegate.onCallEnd(n, 0),
									this._trtcCalling.changeCallStatus(
										u.CALL_STATUS.IDLE
									);
						}),
						(t.prototype._isOnACall = function() {
							return (
								this._trtcCalling.getCallStatus() ===
								u.CALL_STATUS.CONNECTED
							);
						}),
						(t.prototype.onKickedOut = function() {
							l.default.debug(f + '.onKickedOut'),
								this._trtcCalling._delegate.onKickedOut(),
								this._trtcCalling.changeCallStatus(
									u.CALL_STATUS.IDLE
								);
						}),
						(t.prototype.onNetStateChange = function() {
							l.default.debug(f + '.onNetStateChange');
						}),
						(t.prototype.login = function(t) {
							return r(this, void 0, void 0, function() {
								return o(this, function(e) {
									return [2, this._tsignaling.login(t)];
								});
							});
						}),
						(t.prototype.logout = function() {
							return r(this, void 0, void 0, function() {
								return o(this, function(t) {
									return (
										(this._joined = !1),
										[2, this._tsignaling.logout()]
									);
								});
							});
						}),
						(t.prototype.invite = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r, s, a;
								return o(this, function(o) {
									return (
										(e = t.userID),
										(n = t.type),
										(i = t.roomID),
										(r = t.timeout),
										(s = t.offlinePushInfo),
										(a = t.userIDList),
										[
											2,
											this._tsignaling.invite({
												userID: e,
												data: JSON.stringify(
													this.handleNewSignaling(
														{
															version: 0,
															call_type: n,
															room_id: i,
														},
														{ userIDs: a }
													)
												),
												timeout: r,
												offlinePushInfo: s,
											}),
										]
									);
								});
							});
						}),
						(t.prototype.inviteInGroup = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r, s, a;
								return o(this, function(o) {
									return (
										(e = t.groupID),
										(n = t.userIDList),
										(i = t.roomID),
										(r = t.type),
										(s = t.timeout),
										(a = t.offlinePushInfo),
										e
											? [
													2,
													this._tsignaling.inviteInGroup(
														{
															groupID: e,
															inviteeList: n,
															data: JSON.stringify(
																this.handleNewSignaling(
																	{
																		version: 0,
																		call_type: r,
																		room_id: i,
																	}
																)
															),
															timeout: s,
															offlinePushInfo: a,
														}
													),
											  ]
											: [2, this.inviteInGroupTRTC(t)]
									);
								});
							});
						}),
						(t.prototype.inviteInGroupTRTC = function(t) {
							return r(this, void 0, void 0, function() {
								var e,
									n,
									i,
									r,
									s,
									a,
									l,
									u,
									c,
									d = this;
								return o(this, function(o) {
									switch (o.label) {
										case 0:
											(e = t.userIDList),
												(n = t.roomID),
												(i = t.type),
												(r = t.timeout),
												(s = t.offlinePushInfo),
												(a = { code: 0, data: [] }),
												(o.label = 1);
										case 1:
											return (
												o.trys.push([1, 3, , 4]),
												(l = e.map(function(t) {
													return d.invite({
														userID: t,
														type: i,
														roomID: n,
														timeout: r,
														offlinePushInfo: s,
														userIDList: e,
													});
												})),
												[4, Promise.all(l)]
											);
										case 2:
											return (
												(u = o.sent()),
												(a.data = u),
												[3, 4]
											);
										case 3:
											return (
												(c = o.sent()),
												(a.code = 1),
												(a.error = c),
												[3, 4]
											);
										case 4:
											return [2, a];
									}
								});
							});
						}),
						(t.prototype.lastOneHangup = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i;
								return o(this, function(r) {
									switch (r.label) {
										case 0:
											return (
												l.default.log(
													f +
														'.lastOneHangup - params:',
													t
												),
												(e = t.userIDList),
												(n = t.callType),
												(i = t.callEnd),
												this._trtcCalling.isGroupCall() &&
												this._trtcCalling.getGroupID()
													? [
															4,
															this._tsignaling.inviteInGroup(
																{
																	inviteeList: e,
																	groupID: this._trtcCalling.getGroupID(),
																	data: JSON.stringify(
																		this.handleNewSignaling(
																			{
																				version: 0,
																				call_type: n,
																				call_end: i,
																			},
																			{
																				cmd:
																					'hangup',
																			}
																		)
																	),
																	timeout: 0,
																}
															),
													  ]
													: [3, 2]
											);
										case 1:
											return r.sent(), [3, 4];
										case 2:
											return [
												4,
												this._tsignaling.invite({
													userID: e[0],
													data: JSON.stringify(
														this.handleNewSignaling(
															{
																version: 0,
																call_type: n,
																call_end: i,
															},
															{ cmd: 'hangup' }
														)
													),
													timeout: 0,
												}),
											];
										case 3:
											r.sent(), (r.label = 4);
										case 4:
											return (
												(this._joined = !1),
												this._trtcCalling._delegate.onCallEnd(
													this._trtcCalling.getInviterID(),
													i
												),
												[2]
											);
									}
								});
							});
						}),
						(t.prototype.accept = function(t, e) {
							return r(this, void 0, void 0, function() {
								var n, r, a;
								return o(this, function(o) {
									return (
										(n = t.inviteID),
										(r = t.callType),
										(a = s(t, ['inviteID', 'callType'])),
										[
											2,
											this._tsignaling.accept({
												inviteID: n,
												data: JSON.stringify(
													this.handleNewSignaling(
														i(
															{
																version: 0,
																call_type: r,
															},
															a
														),
														e
													)
												),
											}),
										]
									);
								});
							});
						}),
						(t.prototype.reject = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r;
								return o(this, function(o) {
									return (
										(e = t.inviteID),
										(n = t.callType),
										(i = t.isBusy),
										(r = { version: 0, call_type: n }),
										i && (r.line_busy = 'line_busy'),
										[
											2,
											this._tsignaling.reject({
												inviteID: e,
												data: JSON.stringify(
													this.handleNewSignaling(r, {
														message: i
															? 'lineBusy'
															: '',
													})
												),
											}),
										]
									);
								});
							});
						}),
						(t.prototype.cancel = function(t) {
							return r(this, void 0, void 0, function() {
								var e;
								return o(this, function(n) {
									return (
										(e = t.inviteID),
										[
											2,
											this._tsignaling.cancel({
												inviteID: e,
												data: JSON.stringify(
													this.handleNewSignaling({
														version: 4,
														businessID: 'av_call',
														call_type: this._trtcCalling.getCallType(),
													})
												),
											}),
										]
									);
								});
							});
						}),
						(t.prototype.resetJoined = function() {
							this._joined = !1;
						}),
						(t.prototype.switchCallMode = function(t) {
							return r(this, void 0, void 0, function() {
								var e, n, i, r, s, a, l;
								return o(this, function(o) {
									return (
										(e = t.userID),
										(n = t.call_type),
										(i = t.roomID),
										(r = t.timeout),
										(s = t.mode),
										(a = {
											version: 0,
											call_type: n,
											room_id: i,
										}),
										(l = { cmd: 'switchToVideo' }),
										s === u.MODE_TYPE.AUDIO &&
											((a.switch_to_audio_call =
												'switch_to_audio_call'),
											(l.cmd = 'switchToAudio')),
										[
											2,
											this._tsignaling.invite({
												userID: e,
												data: JSON.stringify(
													this.handleNewSignaling(
														a,
														l
													)
												),
												timeout: r,
											}),
										]
									);
								});
							});
						}),
						(t.prototype.handleNewSignaling = function(t, e) {
							return i(i({ extraInfo: '' }, t), {
								version: 4,
								businessID: 'av_call',
								platform: 'Web',
								data: i(
									{
										cmd: u.CMD_TYPE_LIST[t.call_type],
										room_id: t.room_id,
										message: '',
									},
									e
								),
							});
						}),
						t
					);
				})();
			e.default = h;
		},
		function(t, e) {
			t.exports = n;
		},
		function(t, e, n) {
			'use strict';
			Object.defineProperty(e, '__esModule', { value: !0 });
			var i = n(20),
				r = n(1),
				o = n(6),
				s = n(8),
				a = n(9),
				l = 'TRTCCallingDelegate',
				u = (function() {
					function t(t) {
						(this._eventEmitter = t),
							(this._eventStatController = new a.default()),
							o.default.bindController(this._eventStatController);
					}
					return (
						(t.prototype._setInterfaceUpLoad = function(t) {
							return r.default.time(t), new o.default(t);
						}),
						(t.prototype.onError = function(t, e) {
							r.default.debug(
								l + '.onError code:' + t + ' msg:' + e
							),
								this._eventEmitter.emit(i.EVENT.ERROR, {
									code: t,
									msg: e,
								}),
								this._setInterfaceUpLoad(s.default.ERROR)
									.setText('')
									.setEnd();
						}),
						(t.prototype.onSdkReady = function(t) {
							r.default.debug(l + '.onSdkReady params:' + t),
								this._eventEmitter.emit(i.EVENT.SDK_READY, t),
								this._setInterfaceUpLoad(s.default.SDK_READY)
									.setText('')
									.setEnd();
						}),
						(t.prototype.onInvited = function(t) {
							r.default.debug(l + '.onInvited params:', t);
							var e = t.sponsor,
								n = t.userIDList,
								o = t.isFromGroup,
								a = t.inviteData,
								u = t.inviteID;
							this._eventEmitter.emit(i.EVENT.INVITED, {
								sponsor: e,
								userIDList: n,
								isFromGroup: o,
								inviteData: a,
								inviteID: u,
							}),
								this._setInterfaceUpLoad(s.default.INVITED)
									.setText('EVENT.INVITED emitted')
									.setEnd();
						}),
						(t.prototype.onUserAccept = function(t) {
							r.default.debug(l + '.onUserAccept userID:' + t),
								this._eventEmitter.emit(i.EVENT.USER_ACCEPT, {
									userID: t,
								});
						}),
						(t.prototype.onUserEnter = function(t) {
							r.default.debug(l + '.onUserEnter userID:' + t),
								this._eventEmitter.emit(i.EVENT.USER_ENTER, {
									userID: t,
								}),
								this._setInterfaceUpLoad(s.default.USER_ENTER)
									.setText('EVENT.USER_ENTER emitted')
									.setEnd();
						}),
						(t.prototype.onUserLeave = function(t) {
							r.default.debug(l + '.onUserLeave userID:' + t),
								this._eventEmitter.emit(i.EVENT.USER_LEAVE, {
									userID: t,
								}),
								this._setInterfaceUpLoad(s.default.USER_LEAVE)
									.setText('EVENT.USER_LEAVE emitted')
									.setEnd();
						}),
						(t.prototype.onReject = function(t) {
							r.default.debug(l + '.onReject userID:' + t),
								this._eventEmitter.emit(i.EVENT.REJECT, {
									userID: t,
								}),
								this._setInterfaceUpLoad(s.default.REJECT)
									.setText('EVENT.REJECT emitted')
									.setEnd();
						}),
						(t.prototype.onNoResp = function(t, e) {
							r.default.debug(l + '.onNoResp userIDList:', e),
								this._eventEmitter.emit(i.EVENT.NO_RESP, {
									sponsor: t,
									userIDList: e,
								}),
								this._setInterfaceUpLoad(s.default.NO_RESP)
									.setText('EVENT.NO_RESP emitted')
									.setEnd();
						}),
						(t.prototype.onLineBusy = function(t, e) {
							r.default.debug(
								l + '.onLineBusy sponsor:' + t + ' userID:' + e
							),
								this._eventEmitter.emit(i.EVENT.LINE_BUSY, {
									sponsor: t,
									userID: e,
								}),
								this._setInterfaceUpLoad(s.default.LINE_BUSY)
									.setText('EVENT.LINE_BUSY emitted')
									.setEnd();
						}),
						(t.prototype.onCallingCancel = function() {
							r.default.debug(l + '.onCallingCancel'),
								this._eventEmitter.emit(
									i.EVENT.CALLING_CANCEL,
									{}
								),
								this._setInterfaceUpLoad(
									s.default.CALLING_CANCEL
								)
									.setText('EVENT.CALLING_CANCEL emitted')
									.setEnd();
						}),
						(t.prototype.onKickedOut = function() {
							r.default.debug(l + '.onKickedOut'),
								this._eventEmitter.emit(i.EVENT.KICKED_OUT, {}),
								this._setInterfaceUpLoad(s.default.KICKED_OUT)
									.setText('EVENT.KICKED_OUT emitted')
									.setEnd();
						}),
						(t.prototype.onCallingTimeout = function(t, e) {
							r.default.debug(
								l + '.onCallingTimeout userIDList:',
								e
							),
								this._eventEmitter.emit(
									i.EVENT.CALLING_TIMEOUT,
									{ sponsor: t, userIDList: e }
								),
								this._setInterfaceUpLoad(
									s.default.CALLING_TIMEOUT
								)
									.setText('EVENT.CALLING_TIMEOUT emitted')
									.setEnd();
						}),
						(t.prototype.onCallEnd = function(t, e) {
							r.default.debug(
								l + '.onCallEnd userID:' + t + ' callEnd:' + e
							),
								this._eventEmitter.emit(i.EVENT.CALLING_END, {
									userID: t,
									callEnd: e,
								}),
								this._setInterfaceUpLoad(s.default.CALLING_END)
									.setText('EVENT.CALLING_END emitted')
									.setEnd();
						}),
						(t.prototype.onUserVideoAvailable = function(t) {
							r.default.debug(
								l + '.onUserVideoAvailable params:',
								t
							);
							var e = t.userID,
								n = t.isVideoAvailable;
							this._eventEmitter.emit(
								i.EVENT.USER_VIDEO_AVAILABLE,
								{ userID: e, isVideoAvailable: n }
							);
							var o =
								'EVENT.USER_VIDEO_AVAILABLE emitted, userID: ' +
								e +
								', video: ' +
								n;
							this._setInterfaceUpLoad(
								s.default.USER_VIDEO_AVAILABLE
							)
								.setText(o)
								.setEnd();
						}),
						(t.prototype.onUserAudioAvailable = function(t) {
							r.default.debug(
								l + '.onUserAudioAvailable params:',
								t
							);
							var e = t.userID,
								n = t.isAudioAvailable;
							this._eventEmitter.emit(
								i.EVENT.USER_AUDIO_AVAILABLE,
								{ userID: e, isAudioAvailable: n }
							);
							var o =
								'EVENT.USER_AUDIO_AVAILABLE emitted, userID: ' +
								e +
								', mic: ' +
								n;
							this._setInterfaceUpLoad(
								s.default.USER_AUDIO_AVAILABLE
							)
								.setText(o)
								.setEnd();
						}),
						(t.prototype.onUserVoiceVolume = function(t) {
							this._eventEmitter.emit(i.EVENT.USER_VOICE_VOLUME, {
								volumeMap: t,
							}),
								this._setInterfaceUpLoad(
									s.default.USER_VOICE_VOLUME
								)
									.setText('EVENT.USER_VOICE_VOLUME emitted')
									.setEnd();
						}),
						(t.prototype.onGroupCallInviteeListUpdate = function(
							t
						) {
							this._eventEmitter.emit(
								i.EVENT.GROUP_CALL_INVITEE_LIST_UPDATE,
								{ userIDList: t }
							),
								this._setInterfaceUpLoad(
									s.default.GROUP_CALL_INVITEE_LIST_UPDATE
								)
									.setText(
										'EVENT.GROUP_CALL_INVITEE_LIST_UPDATE emitted'
									)
									.setEnd();
						}),
						t
					);
				})();
			e.default = u;
		},
		function(t, e, n) {
			'use strict';
			n.r(e);
			var i = n(1);
			const r = 'none',
				o = 'online',
				s = function() {
					let t = window.location.protocol;
					return (
						['http:', 'https:'].indexOf(t) < 0 && (t = 'http:'), t
					);
				};
			e.default = class {
				constructor() {
					(this._networkType = ''), (this.maxWaitTime = 3e3);
				}
				start() {
					this._networkType = o;
				}
				_onNetworkStatusChange(t) {
					(this._networkType = t.networkType),
						t.isConnected
							? i.default.info(
									'NetMonitor networkType:' + t.networkType
							  )
							: i.default.warn(
									'NetMonitor no network, please check!'
							  );
				}
				probe() {
					return new Promise((t) => {
						if (window && window.fetch)
							fetch(
								`${s()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`
							)
								.then((e) => {
									e.ok ? t([!0, o]) : t([!1, r]);
								})
								.catch(() => {
									t([!1, r]);
								});
						else {
							const e = new XMLHttpRequest(),
								n = setTimeout(() => {
									i.default.warn(
										'NetMonitor fetch timeout. Probably no network, please check!'
									),
										e.abort(),
										(this._networkType = r),
										t([!1, r]);
								}, this.maxWaitTime);
							(e.onreadystatechange = function() {
								4 === e.readyState &&
									(clearTimeout(n),
									200 === e.status || 304 === e.status
										? ((this._networkType = o), t([!0, o]))
										: (i.default.warn(
												`NetMonitor fetch status:${e.status}. Probably no network, please check!`
										  ),
										  (this._networkType = r),
										  t([!1, r])));
							}),
								e.open(
									'GET',
									`${s()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`
								),
								e.send();
						}
					});
				}
				getNetworkType() {
					return this._networkType;
				}
				reset() {
					this._networkType = '';
				}
			};
		},
		function(t, e, n) {
			'use strict';
			n.r(e),
				n.d(e, 'isFunction', function() {
					return i;
				}),
				n.d(e, 'isUndefined', function() {
					return r;
				}),
				n.d(e, 'isString', function() {
					return o;
				}),
				n.d(e, 'isNumber', function() {
					return s;
				}),
				n.d(e, 'isBoolean', function() {
					return a;
				}),
				n.d(e, 'isPlainObject', function() {
					return l;
				});
			const i = (t) => 'function' == typeof t,
				r = (t) => void 0 === t,
				o = (t) => 'string' == typeof t,
				s = (t) => 'number' == typeof t,
				a = (t) => 'boolean' == typeof t,
				l = function(t) {
					if (
						!t ||
						'object' != typeof t ||
						'[object Object]' != Object.prototype.toString.call(t)
					)
						return !1;
					var e = Object.getPrototypeOf(t);
					if (null === e) return !0;
					var n =
						Object.prototype.hasOwnProperty.call(
							e,
							'constructor'
						) && e.constructor;
					return (
						'function' == typeof n &&
						n instanceof n &&
						Function.prototype.toString.call(n) ===
							Function.prototype.toString.call(Object)
					);
				};
		},
		function(t, e, n) {
			'use strict';
			var i,
				r =
					(this && this.__extends) ||
					((i = function(t, e) {
						return (i =
							Object.setPrototypeOf ||
							({ __proto__: [] } instanceof Array &&
								function(t, e) {
									t.__proto__ = e;
								}) ||
							function(t, e) {
								for (var n in e)
									e.hasOwnProperty(n) && (t[n] = e[n]);
							})(t, e);
					}),
					function(t, e) {
						function n() {
							this.constructor = t;
						}
						i(t, e),
							(t.prototype =
								null === e
									? Object.create(e)
									: ((n.prototype = e.prototype), new n()));
					});
			Object.defineProperty(e, '__esModule', { value: !0 });
			var o = n(4),
				s = (function(t) {
					function e(e) {
						var n = e.message,
							i = e.code,
							r = void 0 === i ? o.default.UNKNOWN : i,
							s =
								t.call(
									this,
									n +
										' <' +
										(function(t) {
											for (var e in o.default)
												if (o.default[e] === t)
													return e;
											return 'UNKNOWN';
										})(r) +
										' ' +
										r +
										'>'
								) || this;
						return (
							(s.code_ = r),
							(s.name = 'TRTCCallingError'),
							(s.message_ = n),
							s
						);
					}
					return (
						r(e, t),
						(e.prototype.getCode = function() {
							return this.code_;
						}),
						e
					);
				})(Error);
			e.default = s;
		},
	]).default;
});
